Configure Automatic SSH connectivity.

Configure Automatic SSH connectivity between Source and Traget servers-----

 Configuration Steps -----

> Loging to the Linux machine with root user.

> Generate the RSA key with the following command.

Command: #ssh-keygen -t rsa

Accept the default file location of /root/.ssh/id_rsa. Enter a passphrase different from your account password and confirm it by entering it again.
The public key is written to /root/.ssh/id_rsa.pub.
The private key is written to /root/.ssh/id_rsa.



> Change the permissions of the .ssh directory using the following command.

Command:  #cd /root                       ------ Got to root directory
                     #chmod 755 .ssh          ------ Change the permission of .ssh directory

> Copy the contents of "/root/.ssh/id_rsa.pub" to target linux machine's directory "/root/.ssh/"

Command: #rsync -avr /root/.ssh/id_rsa root@<Target Server IP>:/root/.ssh/

Target server is the machine which you want to connect throw ssh ( Automatic ssh connectivity ).

>  Rename the file id_rsa.pub to authorized_keys in the target linux machine.

Command: #mv /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys

> Change the permissions of authorized_keys file.

Command: #chmod 644 /root/.ssh/authorized_keys

> Access the target linux machine from your base machine with ssh command to check the results.
Target server will not ask the password to connect.

EOF


Comments