>

Introduction

ssh search ~/.ssh/id_rsa by default, if you have multiple keys or your key’s name is not the default, you should add the key into ssh-agent so that ssh can search for it.

1
eval "$(ssh-agent -s)"

you can config ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.

1
2
3
4
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa

If github still ask you for password, you’re probably using the HTTPS clone URL for your repository. To solve it,

(1) Update the URL of origin remote using SSH instead of HTTPS

1
git remote set-url origin git@github.com:username/repo.git

(2) Make Git store the username and password and it will never ask for them.

1
git config --global credential.helper store

Calculate fingerprint from RSA keys

1
ssh-keygen -lf ~/.ssh/id_rsa.pub

In newer versions of OpenSSH, Base64 encoded SHA-256 is shown instead of hexadecimal MD5. To show the legacy style hash, use

1
ssh-keygen -l -E md5 -f ~/.ssh/id_rsa.pub