SSH клиент / сервер

$ ssh-keygen -t rsa -C "admin@d7.debian.loc"
$ ssh-keygen -t dsa -C "admin@d7.debian.loc"
 
$ cat ~/.ssh/id_rsa.pub | ssh user@hostname "cat >> ~/.ssh/authorized_keys"
 
$ ssh user@hostname
$ sudo sed -i "s/^\#RSAAuthentication.*$/RSAAuthentication yes/g" /etc/ssh/sshd_config
$ sudo sed -i "s/^\#PubkeyAuthentication.*$/PubkeyAuthentication yes/g" /etc/ssh/sshd_config
$ sudo /etc/init.d/sshd restart

Отладка подключения

ssh -vvv -o PreferredAuthentications=publickey name@host -p port
  • -o PreferredAuthentications=publickey - опции аунтефикации