I am setting up Git usage on Raspbian. This worked OK:
cd .ssh
ssh-keygen -t rsa -b 4096 -C "[email protected]"
eval $(ssh-agent -s)
ssh-add ./id_rsa_rpi
After I created the keys locally, I went to GitHub and added a public key there.
It all worked OK, I cloned a few repositories without problems. Confirmed it all with ssh -vT [email protected]
However, after a shutdown yesterday and a powerup today, git pull didn't work:
[email protected]: Permission denied (publickey).
I had to repeat the following:
eval $(ssh-agent -s)
ssh-add .ssh/id_rsa_rpi
Now it works again.
How do I make this permanent?
eval $(ssh-agent -s)during its startup, which will then give you session info in all subprocesses.