This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
SSH atau Secure Shell merupakan protokol jaringan untuk melakukan pertukaran data melalui saluran yang lebih aman dari telnet. Salah satu penggunaannya untuk melakukan remote komputer jarak jauh.
Karena itu pemakaian password untuk remote SSH harus menggunakan kata yang susah. Agar tidak perlu mengingat password SSH, maka perlu generate SSH-Keygen.
localhost adalah hostname komputer personal, sedangkan remotehost adalah hostname komputer server yang akan diremote melalui komputer local.
1. Membuat Public dan Private Keys di localhost
user@localhost:~# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/user/.ssh/id_rsa): // Tekan Enter Enter passphrase (empty for no passphrase): // Tekan Enter Enter same passphrase again: // Tekan Enter Your identification has been saved in /user/.ssh/id_rsa. Your public key has been saved in /user/.ssh/id_rsa.pub. The key fingerprint is: e9:14:59:d2:db:9b:38:bd:2d:b4:50:a1:bc:98:ee:55 user@localhost
2. Copy Public Key ke remotehost menggunakan ssh-copy-id
user@localhost:~# ssh-copy-id -i ~/.ssh/id_rsa.pub root@remotehost root@remotehost's password: // Masukkan password root dari remotehost Now try logging into the machine, with "ssh root@remotehost", and check in:  .ssh/authorized_keys  to make sure we haven't added extra keys that you weren't expecting.
3. Login ke remote tanpa password
Sekarang sudah dapat login ke remotehot tanpa memasukkan password
user@localhost:~# ssh root@remotehost
Walaupun password root di remotehost diganti, masih dapat login tanpa meminta password dari remotehost.