Contents...
In this tutorial I will describe how you can setup SSH login without password using ssh-keygen and ssh-copy-id. ssh-keygen is used to create the public and private keys and ssh-copy-id used to copies the local host’s public key to the remote-host’s authorized_key file. ssh-copy-id also assigns proper permission to the remote-host’s home, ~/.ssh, and ~/.ssh/authorized_keys.
Follow the below steps to login your remote Linux server without password.
Step #1: Creating Public and Private keys Using ssh-key-gen
user@local-host$ [local-host here] user@local-host$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa):[Press Enter key] Enter passphrase (empty for no passphrase): [Press enter key] Enter same passphrase again: [Press enter key] 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: 33:b3:fe:af:95:95:18:11:31:d5:de:96:2f:f2:35:f9 user@local-host
Step #2: Copy Public Key on Remote Host using ssh-copy-id
user@local-host$ ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host user@remote-host's password: try logging into the machine, with "ssh 'remote-host'", and check in: .ssh/authorized_keys Make sure we haven't added any extra keys.
Note :- ssh-copy-id will append the keys to the remote host’s .ssh/authorized_key.
Step #3: Login to Remote Host without Password
user@local-host$ ssh remote-host Last login: Mon Feb 17 17:22:33 2017 from 192.168.1.5 [Here SSH will not ask for type password.] user@remote-host$ [Here you are on remote host]
That’s it.
I hope this article will help to setup SSH Login Without Password. If you have any queries and problem please comment in comment section.
Thanks:)
If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.
Leave a Comment