SSH Connection between the linux hosts


Hello  folks,

Here I would like to give steps to build a SSH connection between two Linux hosts.

Example hosts: abc.com & xyz.com

  1. Login to abc.com
  2. Navigate to "$cd .ssh/" directory from root. Incase the directory is not available simply create it in root "/".
  3. Execute the following command "ssh-keygen -t rsa"
  4. Change the permissions to "id_rsa.pub" file "chmod 600 id_rsa.pub"
  5. Do cat id_rsa.pub and copy the content.
  6. Create "authorized_keys" file in same directory. Do vi and paste the content. If file is already exist paste the content at bottom of the file.
  7. Create "authorized_keys" file in .ssh/ directory in remote host (xyz.com). Do vi and paste the content.
  8. Perform steps 1 to 6 in remote host (xyz.com) and copy the content in "id_rsa.pub" and paste it in "authorized_keys" file in remote host(abc.com).
  9. Execute the following command to check the SSH connection.
    1. Login to abc.com
    2. $ssh xyz.com (First time it will ask password to login xyz.com)
    1. Execute same command in xyz.com to check ssh connection to abc.com.
Hope this post will useful.
Feel  free to post your comments if you any question regarding this…

Cheers!!!

Comments

Popular Posts