How to Setup SSH Passwordless login in 5 easy steps

In this Post we will discuss How to Setup SSH Passwordless login in 5 easy steps.


SSH(Secure shell) is a software package that enables secure system administration and file transfers over insecure networks.
In this post, we will show you ssh passwordless login on Red-Hat, CentOS, Ubuntu and Oracle Linux using ssh keys to connect to remote Linux servers without entering a password. Using Password-less login with SSH keys.
ssh passwordless login

If you are connecting with a number of Linux remote servers, then SSH Password-less login is one of the best ways to automate tasks.

Test Environment Lab Setup
  • SSH Client Host:
  • SSH Remote Host:

In this example, we will set up SSH password-less automatic login from client server as user xymon to remote server with user xymon.

How to do SSH passwordless authentication in Linux?.
Step 1:
Create Authentication SSH-Keygen Keys on Client host (
First login into client server with user xymon and generate a pair of public keys using the following command.
ssh passwordless login

Step 2:

Create .ssh Directory on Remote server – Use SSH from server to connect server using xymon as a user and create .ssh directory under it, using the following command.

  • [xymon@myaansible ~]$ ssh xymon@ mkdir -p .ssh
  • xymon@’s password:         “Enter your Password

Step 3:

Upload Generated Public Keys on Remote Host – Use SSH from client server and upload a new generated public key ( on Remote server under xymon‘s .ssh directory as a file name authorized_keys.

  • [xymon@myaansible ~]$ cat .ssh/ | ssh xymon@ ‘cat >> .ssh/authorized_keys’
  • xymon@’s password:            “Enter your Password

Step 4:

Set Permissions on Remote server – .We need to set permissions on Remote server for .ssh directory and authorized_keys file.

  • ssh xymon@ “chmod 700 .ssh; chmod 640 .ssh/authorized_keys”

Step 5:

Login from client server to remote server Server without Password.

Leave your message if anything missed and we appreciate your comments. You can also watch this video “Setup Passwordless SSH Login”. Click Next

Related Posts

Leave a Reply

Your email address will not be published.