SSH Authentication

  • Generate key pair

    • Linux: # ssh-keygen -t rsa
    • Putty: puttygen.exe
  • Load the private key in the PuTTY profile

  • Copy the public key to ~/.ssh/authorized_keys

  • Change permissions on folders

    • chmod 700 ~/.ssh
    • chmod 600 ~/.ssh/authorized_keys
  • Change owner on folder

    • Chown $USER:$USER ~/.ssh -R
  • Verify that folders aren’t group/world writeable

    • chmod go-w $HOME $HOME/.ssh $HOME/.ssh/authorized_keys
  • Edit sshd_config

    • # nano /etc/ssd_config
    • Make sure that a line says ‘AuthorizedKeysFile %h/.ssh/authorized_keys’
  • Restart SSH

    • # service ssh restart