1830481 Members
2720 Online
110005 Solutions
New Discussion

Password Less Login

 
SOLVED
Go to solution
Indrajit Bhagat
Regular Advisor

Password Less Login

Hi All

I had tried this Method for password less login but it seems not working


1.Login to serverA as user1.

2.$ssh-keygen -t dsa
Press enter for all the questions.It will create the private/public keys
under $HOME/.ssh/
File names are id_rsa and id_rsa.pub

3.Now you need to copy the id_rsa.pub file content into ServerB $HOME/.ssh/authorized_keys file
ServerA#scp ~user1/.ssh/id_rsa.pub ServerB:/tmp

Login to ServerB server

ServerB#cat /tmp/id_rsa.pub >> ~user1/.ssh/authorized_keys

Make sure the following permissions on serverB.

Home directory should have 755 permission (users home directory)
$HOME/.ssh directory should have 700 permission
$HOME/.ssh/authorized_keys file should have 600 or 640 permission

Please suggest if some modification need to me made
5 REPLIES 5
Aneesh Mohan
Honored Contributor
Solution

Re: Password Less Login

Please try the following:
ServerA and ServerB both should run the ssh daemons.To allow ServerA to SSH to ServerB without password


Login to the source server (server A)


# ssh-keygen -t rsa

accpet all defaults sttings.

This generates two files id_rsa.pub and id_rsa

Now,id_rsa.pub needs to be appended to the authorized_keys file on ServerB


Rename this file to some other name , for identification.

#mv id_rsa.pub _rsa.pub

copy this file to serverB.


# scp _rsa.pub ServerB:~/.ssh/_rsa.pub

Login to server B

move to the .ssh folder under your home directory


Take a backup of the file authorized_keys

#cp -p authorized_keys authorized_keys.backup

# cat _rsa.pub >> authorized_keys


Now try login from server A to B

Note: If you are implementing it first time there will not be any authorized_keys file. So you can simply rename the file id_rsa.pub _rsa.pub to authorized_keys
Repeat this process starting from server B to A to allow passwordless login from server B to A


Aneesh
Steven Schweda
Honored Contributor

Re: Password Less Login

> [...] it seems not working

Not a very detailed description of anything.
You might:

Look at any of the dozens of old threads on
this topic.

Show what "seems not working".

Add "-v" (or "-vv", ...) to your (invisible)
"ssh" command.

Look for interesting messages in the system
log file(s) on the server system.


> 2.$ssh-keygen -t dsa
> [...]
> File names are id_rsa and id_rsa.pub

You put DSA keys into files named "*rsa*"?
Chandrahasa s
Valued Contributor

Re: Password Less Login

Hi,

Refer attached document.


Chandra

Assigning points will motivate each one in this forum
Indrajit Bhagat
Regular Advisor

Re: Password Less Login

Thanks to all , who had replied for this thread..The solution provided by you is working..

I had assighned a points to all.

Regards
Indrajit

Re: Password Less Login

And what is the difference with the steps you described (apart from RSA-DSA mixup in key generation)? What was the issue, what fixed the issue ?