SSH-PASSWORDESS
SSH: SSH (SECURE SHELL ) is an Open Source and most trusted protocol that is used to remote login to other Linux Machines.
Scenario: If you would like to connect to another remote host via command line we can use ssh <hostname> to connect to the host by entering username and password.
Command:
server1$ ssh server2
password:
one you have entered the password you will be login to the server2 via command line.
In IT Industry we may need to work with multiple hosts. Entering a password every time connecting to other hosts is a very time-consuming and repetitive task. to overcome this we have a password-less authentication method using ssh keys.
Generating ssh keys:
$ssh-keygen -t rsa (Press Enter for every question asked after executing the command)
This generates the RSA keys id_rsa and id_rsa.pub keys
now you can manually append the authorized_keys on the remote host(server2) with the .pub key on the node(server1) on which you have created the keys.
or run the below command which does the work for you
$ssh-copy-id server2 (Enter the password for one last time Boom now you have set up your password less ssh authentication)
Comments
Post a Comment