How to Setup password-less connection via ssh in Linux

In this article we will show you how to setup password-less login using ssh keys to connect to remote Linux servers without entering password. Using Password-less login with SSH keys will increase the trust between two Linux servers for easy file synchronization or transfer.
SSH Password-less login is one of the best way to automate tasks such as automatic backups with scripts, synchronization files using scp and remote command execution.

Let’s follow the steps in creating the password-less connection.

  • 1- First you need ot install SSH-client .
  • 2- Generate a pair of public keys.
  • To do so you need to use the commnads:(just press enter until the process finishes)

  • 3- Set directory permission
  • Next make sure you have correct permission on .ssh directory:

  • 4- Create the file authorized_keys inside .ssh folder and copy the content of the inside of it.
  • Similar Article  What are the Linux FSTAB and MTAB files

    This will hold the used keys for password-less connection.

  • 5- Change the permission on authorized_keys.
  • 6- Do the same on the other server where you want to connect password-less.
  • Just follow the first 5 steps.

  • 7- Copy public key from one server to another and place it inside the authorized_keys file.
  • Then try to connect to the server. You will be asked if you want to continue and the host will be added to to the known_hosts file.

    And that is it – ssh password-less is configured.


    I hope this was helpful and i appreciate if you would like, subscribe or share our posts. I it is just a click


    No Comments
    Leave a Comment

    %d bloggers like this: