Wednesday 24 August 2016

SSH without password access in RHEL

Step 1

Login to server that user going to access without password. Then create ssh keygen rsa with below command.

ssh-keygen -t rsa

then it will show some contents just give enter for all like below image.


Step 2

by default the user will not have the .ssh directory for rsa. So we have to create that directorie with below command

ssh test@ipaddress mkdir -p .ssh

Step 3

Now upload the generated rsa key to the client server with following command.

cat .ssh/id_rsa.pub | ssh test@ipaddress 'cat >> .ssh/authorized_keys'

Step 4

Now set the permission to access the file to user with following command.

ssh test@ipaddress "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"

Step 5

try to login it should not ask password.

ssh test@ipaddress

That's All....

No comments:

Post a Comment

Permanent hostname setup for RHEL7

Step 1 Set the host name on NMTUI tool like following nmtui set host name   then save and exit Step 2 add the following l...