Change where SSH looks for key files on Windows

By default, my ssh looks for private key identities in /.ssh/ when I connect. However, this is not a valid place in a Windows system. How can I permanently change the default place that it looks for the private key identities, so I don't need to run ssh-add every time I want my keys?

Note: I got SSH when I installed mysysgit, the Windows version of Git (which comes with all the ssh executables in its /bin directory). I think it looks in this place because it expects me to use the MinGW git bash it comes with. However, I want to work from the cmd.exe prompt so I need it to look in a valid Windows folder.

1 Answer

ssh from OpenSSH normally uses ~/.ssh/, where ~ represents your home directory. To make it work on Windows, set the HOME environment variable apropriately.

set HOME=%USERPROFILE%
set HOME=C:\Users\babonk
3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like