
#GIT FOR WINDOWS SSH KEY LOCATION KEYGEN#

Now click on Add SSH Key button.Ĭongrats, you have added public key to github successfully and now you can use gitbash to access github repositories. Switching between multiple ssh keys in Git on Windows.

Connect and share knowledge within a single location that is structured and easy to search. If you dont have an existing key youd like to use already, you will need to generate a new key file for your account. Give some meaningful title to the key and paste the public key copied in step 4 above. Corresponding to the two accounts, I have two ssh keys in my. Open Git Bash and run the following: ssh-keygen -t rsa -b 4096 -C When youre prompted to Enter a file in which to save the key. Go to /c/Users/username/.ssh/ folder and open id_rsa.pub file and copy entire contents of it.įinally, go to Github -> Settings -> SSH And GPG keys -> Click New RSA (Green Button). Identity files may also be specified on a per-host.

The default is /.ssh/identity for protocol version 1, and /.ssh/idrsa and /.ssh/iddsa for protocol version 2. You can press enter if you want to leave it blank but its not recommended.Įnter passphrase (empty for no passphrase): Įnter same passphrase again: ssh has the -i option to tell which private key file to use when authenticating: Selects a file from which the identity (private key) for RSA or DSA authentication is read. This accepts the default file location.Įnter a file in which to save the key (/c/Users/username/.ssh/id_rsa):Īt the prompt, type a secure passphrase. Open Git Bash and run below command on command prompt to generate public-private key pair ssh-keygen -t rsa -b 4096 -C you are prompted to "Enter a file in which to save the key," press Enter.
