Wednesday, February 15, 2012

Configuring SSH: Secure Passwordless Login

  • Create a passphrase protected ssh key.
> ssh-keygen -b 2048 -t rsa
  • Add an ssh-agent to your session startup. (ie. SSHKeychain on Mac OS)
  • Whenever you start a session add your ssh key to your agent. (ie. ssh-add)
  • Make sure your agent follows you.
ForwardAgent yes
  • ssh to a server and put your public key in the authorized_keys file. (ie. ssh-add -L > ~/.ssh/authorized_keys)
  • Fix the permissions, just in case. (ie. chmod 600 ~/.ssh/authorized_keys)
  • Logout, and try and log back in without a password.

§