SSH tanpa password
1. buat file id_rsa
alex:~ # ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
a1:9f:9c:4f:3c:78:7f:47:c6:ac:20:22:1d:84:cd:73 root@alex
2. Cek dulu apakah file sudah terbentuk
alex:~ # ls .ssh/
id_rsa id_rsa.pub known_hosts
3. Penasaran sama isinya
alex:~ # cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAqRB18gF/k5pk2N07ynqbdyLuYdTuF5HeMeoNgE7GkQkS8E2i4432A8COSY5GxsBsoHwsn2hSEmL7X0cocTisOXx4kf55rNAg/4Amn7q5mOj0I2D8fBfeOgkGGm+eQZ8O3O14U6p7M5TBfj9OEmO9uukxzZFO3w4L8S3vh5MuKuME7BqI/7+T2SIfe7xnUvuND+jT8d5+vRLmVxrD1JS6rpVvr+q6x2Bk2lXLaFRkNxhEwpmKhnufyr5LWBxpDPvleQHhqJ7URyhBUKX4heVR0xxdJDHYcgNBXr6NKQeJkb1lZcYhVQz+XaK4pTvey9BkVKFPloodaAz+oZEds6wO/w== root@alex
4. Setelah pusing2 baca isinya n gak ngerti, copykan file id_rsa.pub ke komputer yang akan diremote (direktori /root/.ssh/)
alex:~ # scp /root/.ssh/id_rsa.pub root@10.1.0.254:/root/.ssh/
Password:
id_rsa.pub 100% 391 0.4KB/s 00:00
5. ssh dulu komputer tadi sekalian rename file id_rsa.pub menjadi authorized_keys
alex:~ # ssh -X 10.1.0.254
Password:
Last login: Mon Dec 22 15:43:03 2008 from ws002.ltsp
Have a lot of fun…
harfa:~ #
harfa:~ # mv .ssh/id_rsa.pub .ssh/authorized_keys
6. Logout
harfa:~ # exit
logout
Connection to 10.1.0.254 closed.
7. Bisa deh login ke remote PC tanpa password
alex:~ # ssh -X 10.1.0.254
Last login: Mon Dec 22 15:47:05 2008 from ws002.ltsp
Have a lot of fun…