I'm trying to configure GIT on my Windows XP machine, but SSH keeps creating and looking for the public/private key pair in non-sensical places, e.g. /.ssh/id_rsa
Is there a configuration file in the GIT Installation for Windows where I can switch this to my home directory, or another user defined place? By default, it offers to create new key pairs at //.ssh/id_rsa but that gives me the error "Could not create directory '//.ssh'." And when I'm able to find a directory I can create it in, GIT won't look there.
The public part of the key is saved in the id_rsa. pub file, while the private part is saved in the id_rsa file. Both files can be accessed from this location using Explorer: C:\Users\[your user name]\. ssh .
Enter file in which to save the key (C:\Users\username/. ssh/id_ed25519): You can press Enter to accept the default, or specify a path and/or filename where you would like your keys to be generated. At this point, you'll be prompted to use a passphrase to encrypt your private key files.
Log into the remote system using your account username and password. Note: If the remote system is not configured to support password-based authentication, you will need to ask system administrators to add your public key to the ~/. ssh/authorized_keys file in your account (if your account doesn't have ~/.
By default, the keys will be stored in the ~/. ssh directory within your user's home directory. The private key will be called id_rsa and the associated public key will be called id_rsa. pub .
Figured out how to manually set my home directory in Windows XP:
To do the same via command prompt do :
setx HOME "your\path\to\home"
( Please note the suffix x - This is used to persist the change )
Recommended method from MSYS2 is to set db_home
in /etc/nsswitch.conf
to your home directory.
Credit to @VarunAgw for pointing in the right direction.
Git-for-Windows includes env
in db_home
, which should read your HOME
bash variable, however, it is unreliable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With