0

So, I followed this to configure my SSH -Setting up SSH keys for Bitbucket on Windows- and it works as expected.

For a reason out of knowledge, control and understanding.... The %HOMEDRIVE% on my computer is set to Q (a network drive), resulting on GIT storing and looking for my ssh keys on Q:\Users\MyUser\.ssh.

I can tell git to create the keys on C:\Users\MyUser\.ssh (or just copy them from Q to C). But when I want to do a git pull, git looks for my keys on Q instead of C, and obviously fails to connect.

Any idea on how to tell git to always look for SSH keys and configurations on a specific folder?

Thanks, R.

p.d. My %HOMEPATH% is propperly configured... if i could at least tell git to use the %HOMEPATH% instead of %HOMEDRIVE%... that could probably be a fix too.

--UPDATE--

I created a config file, that redirects ssh.exe from Q to C

Host MyHost
    HostName MyIP
    Port MyPort
    StrictHostKeyChecking no
    UserKnownHostsFile /C/Users/MyUser/.ssh/known_hosts
    IdentityFile /C/Users/MyUser/.ssh/id_rsa

So, being able to specify a location for the config file would also help.

Rafa
  • 443
  • 5
  • 14
  • As a workaround, you can try creating a symbolic link/junction from `C:\Users\MyUser\.ssh` to `Q:\Users\MyUser\.ssh`. – Martin Prikryl Nov 26 '19 at 12:28
  • Ok, I tried with `ln` and `mklink`, didn't work (neither with soft link or hard link), maybe because Q is a network drive – Rafa Nov 26 '19 at 13:43

1 Answers1

0

So far I solved my issue (in a way i don't really like)... But my solution doesn't answer my question.

I added a variable to my user variables called HOME and set it to C:\Users\MyUser. Basically what rolyat suggested in this thread change-the-default-location-for-git-bash

I don't know the reason why my organization configures %HOMEDRIVE% to Q and I don't know if my variable will later affect me accessing network resources or receiving windows updates from my organization...

At least this way i am not dependent on the network drive anymore.

Rafa
  • 443
  • 5
  • 14