ssh password less login

If you do not want to type SSH password every time when you login to the remote server remotely by SSH. So it can be done by a public key. You can do ssh login with command or ssh no password prompt and ssh to Linux server.

SSH Password less login Using SSH Keygen:

You will have to create an SSH key for a user and I have a user Aryan and the Password is ****.

Check OutDisable SSH For Root Login

By default, there won’t be any .ssh directory in the user profile. So you will have to make it. 

ls -a

Step 1: Create a Directory .ssh and inside create a file name authorized_keys

mkdir .ssh
touch authorized_keys

Check Out: Create SSh Key

Step 2: Create an SSH Key

ssh-keygen -t rsa

It will create a public key, you just need to copy it and paste inside authorized_keys on the remote host.

You can see the SSH key by running the below command

cat .ssh/id_rsa.pub
ls .ssh/

Step 3: Now copy the key from id_rsa.pub to authorized_keys

Check OutInstall SSH agent

Then change the permission on directory and file

chmod 700 .ssh
chmod 640 authorized_keys

Now try to login with the user ‘Aryan’ from the client machine.

That’s it.  . ssh no password prompt ssh login command ssh server linux

LEAVE A REPLY

Please enter your comment!
Please enter your name here