As the title above, this post is intended to Windows users that have Git installed and would like to generate SSH keys pair to be used in Github instead of using HTTPS. Why would someone use SSH in connecting with Github?. There are many reasons, one of the reason is this fatal: could not read Username for “https://github.com”: No such file or directory
Generate SSH Keys
GeneratingSSH keys is simple. On Windows, Git comes with preinstalled software named Git GUI. Open it and go to Help->Show SSH Key
After the window is open click “Generate Key“. Enter the “passphrase” with everything you want but easy for you to remember, it’s just like password. The result is something like this.
Don’t forget to copy that key and we will paste it later.
Add SSH Key to Github
Open your Github “Account Setting“, it’s located on right top corner.
Click “SSH Keys” in the left sidebar
Paste the key you copied earlier into the “Key” field
The last, confirm the action by entering your GitHub password.
Test It
Everything has been set up, now is time to test it. Open “Git Bash” and type
1 |
ssh -T git@github.com |
you will be prompted to type in your passphrase, enter it.
You may see this warning
1 2 3 |
The authenticity of host 'github.com (207.97.227.239)' can't be established. # RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. # Are you sure you want to continue connecting (yes/no)? |
Type “yes”
If the username is you then congratulation!
“Hi username! You’ve successfully authenticated, but GitHub does not
# provide shell access.”
Buat akun git