I want to do the following three things:
- Log on to my remote server from my local server without having to type in a password every time
- Have my local server read from and write to a remote repository stored on GitHub, again without a password
- Have my remote server read from that same remote repo, no password
Obviously the answer is SSH keys.
I have created an SSH key pair, stored in ~/.ssh/id_rsa
and ~/.ssh/id_rsa.pub
respectively. I have added them to the ssh-agent using $ ssh-add
and noted the passphrase. I've logged on to my remote server and added the contents of id_rsa.pub
to ~/.ssh/authorized_keys
on a new line. I can now run $ ssh root@[example.com]
and I am logged on without being prompted for my password. Brilliant!