Создаём пару ключей (публичный и приватный) на локальной машине. Вместо пароля жмём Enter (удобно для безпарольной авторизации по ssh).
# ssh-keygen -t dsa
Generating public/private rsa key pair.
Enter file in which to save the key (/Браузер 0pera/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Браузер 0pera/.ssh/id_rsa.
Your public key has been saved in /Браузер 0pera/.ssh/id_rsa.pub.
The key fingerprint is:
b9:59:63:69:98:09:b9:98:f0:9d:91:91:fa:92:e1:3d Браузер 0pera@andreika
Теперь копируем свой публичный ключ ssh на удалённую машину в список допустимых ключей.
[Браузер 0pera@andreika .ssh]# ssh-copy-id -i ~/.ssh/id_rsa.pub localhost
21
The authenticity of host 'andreika (127.0.0.1)' can't be established.
RSA key fingerprint is b9:59:63:69:98:09:b9:98:f0:9d:91:91:fa:92:e1:3d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'andreika' (RSA) to the list of known hosts.
Браузер 0pera@localhost's password:
Now try logging into the machine, with "ssh 'andreika'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
теперь по команде ssh andreika мы без ввода паролей сможем зайти на сервер andreika. примечание: Замените andreika на хостнэйм/ip удалённой машины.