Operating System - Linux
1827894 Members
1649 Online
109969 Solutions
New Discussion

Problem with two-way key-based ssh connection

 
SOLVED
Go to solution
Andrew Kaplan
Super Advisor

Problem with two-way key-based ssh connection

Hi there --

I am trying to set up a two-way key-based ssh connection. The idea here is to have the user on server 1 be able to log into server 2 using public/private key authentication and vice versa.

The user is prompted for a password when he logs in from server 1 to server 2, which is incorrect, but is not prompted for a password when he logs in from server 2 to server 1, which is correct.

The steps that I took so far are as follows:
1. created the rsa and dsa key pairs on server 1 as the user.
2. logged in as root on server 2 and created a user account like that on server 1.
3. copied the user's rsa and dsa public key files to server 2, and renamed the dsa public file to authorized_keys2.
4. verified there was no existing known_hosts file.
5. logged back into server 2 to create the known_hosts file.
6. modified the sshd_config file to have the lines:
Protocol 2
AuthorizedKeysFiles .ssh/authorized_keys2
7. modified the ssh_config file to have the line:
Protocol 2
8. stopped and restarted ssh on server 1 and server 2.

I want to be able to log into server 2 from server 1 without password authentication. I can do that now from server 2 to server 1. What other steps do I need to take to correct this? Thanks.
A Journey In The Quest Of Knowledge
2 REPLIES 2
Steven E. Protter
Exalted Contributor
Solution

Re: Problem with two-way key-based ssh connection

Shalom,

99.9% of the time its ownership and permissions on the user home directory and the .ssh directory.

Or the files in .ssh

Try making the ownership and permission on the non-working system patch the working system.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Andrew Kaplan
Super Advisor

Re: Problem with two-way key-based ssh connection

Hi there --

That seemed to do the trick. Thanks for the help.

A Journey In The Quest Of Knowledge