Login ke server linux dengan SSH tanpa password

Untuk login ke server linux lebih aman memang harus menggunakan password tapi ada hal lain yang kita lebih enak tanpa password contoh real nya ketika kita mau membackup dengan metode sinkronis dengan tools rsync ( console ) Grsync ( GUI ) dan meletekan proses tersebut di penjadwalan ( crontab ) ribet x ya kalo setiap script backup kita harus standby untuk isi password,engga canggih ah,ok ini langsung aja kita ke TKP

Di sisi client ( yang mau nge remote ke server )

root@dedix-IT:/home/dedix# 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:
3f:b1:05:d1:51:2f:79:47:a2:81:2a:f5:85:96:51:49 root@dedix-IT
The key's randomart image is:
+--[ RSA 2048]----+
|          oOE+o .|
|        . =.+o = |
|       . +... o +|
|      . . ..   o.|
|       .S . .    |
|         . +     |
|          +      |
|           .     |
|                 |
+-----------------+

Jika ada pertanyaan tekan aja Enter

Selanjutnya kita copy file key private & public ke server yang akan kita jadi login tanpa password ( copy file dari client ke server remote )

root@dedix-IT:/home/dedix#scp ~/.ssh/id_rsa.pub root@192.168.0.200:~]

Kita login dulu dengan password,lalu lakukan perintah ini di sisi server

cat id_rsa.pub >> ~/.ssh/authorized_keys

Setelah kita copy ke server tugas kita beres,tinggal test aja login ke server tanpa password lagi

root@dedix-IT:/home/dedix# ssh root@192.168.0.200
Last login: Tue Jan 25 02:00:06 2011 from dedix

Finally,kita bisa rsyn ke server untuk backup data di server tanpa password untuk login nya

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s