poniedziałek, 19 września 2011

Klucze dla ssh

Generacja kluczy:

ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
58:a9:ba:a9:c4:58:c0:18:1c:ef:f4:5c:9c:69:f2:73 user@laptop
The key's randomart image is:

Kopiowanie na serwer i dopisanie do pliku:

scp -P port /home/user/.ssh/id_rsa.pub user@zdalny_serwer:~/
ssh user@IP -p port
cat ~/id_rsa.pub >> ~/.ssh/authorized_keys

Wyłączenie logowania z hasłem

# /etc/ssh/sshd_conf
PasswordAuthentication no