SSH Public key Authentication Issue | Unix Linux Forums | Red Hat

  Go Back    


Red Hat Red Hat is the world's leading open source technology solutions provider with offerings including Red Hat Enterprise Linux (RHEL), Fedora, open source applications, security and systems management, virtualization, and Services Oriented Architecture (SOA) solutions.

SSH Public key Authentication Issue

Red Hat


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 12-15-2010
maverick_here maverick_here is offline
Registered User
 
Join Date: May 2009
Last Activity: 5 August 2014, 2:46 PM EDT
Location: Hyderabad
Posts: 127
Thanks: 0
Thanked 5 Times in 4 Posts
SSH Public key Authentication Issue

Hi All;

I have an issue with password less authentication via ssh ( v2)

I have two servers Server A and Server B, following are the server details



Code:
Server A 

OS - HP UX B.11.11 U 9000/800
SSH - OpenSSH_4.3p2-hpn, OpenSSL 0.9.7i 14 Oct 2005
HP-UX Secure Shell-A.04.30.000, HP-UX Secure Shell version


Server B 

OS - Red Hat Enterprise Linux AS release 4 (Nahant Update 3)
SSH -OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003

I have copied the public keys across both the servers and pasted them in authorized_keys file. Following are the things i have checked

a] .ssh -- direcotry permission is set to 700 on both boxes
b] authorized_keys file is 640 in terms of permission

The issue is I m able to connect to Server A from Server B as user xyz ( whose keys have been exchanged for paswordless auth) .When I try the same from Server B to Server A I fail and it prompts me for a password.

Following is the debug log


Code:
ssh -v ServerA
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to ServerA [xx.xx.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /home/xyz/.ssh/identity type -1
debug1: identity file /home/xyz/.ssh/id_rsa type 1
debug1: identity file /home/xyz/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3p2-hpn
debug1: match: OpenSSH_4.3p2-hpn pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.9p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'uxcati02' is known and matches the RSA host key.
debug1: Found key in /home/xyz/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /home/xyz/.ssh/identity
debug1: Offering public key: /home/xyz/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/xyz/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
Password:

Any ideas

Thanks
Syed
Sponsored Links
    #2  
Old 12-15-2010
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 26 August 2014, 2:11 PM EDT
Location: Southern NJ, USA (Nord)
Posts: 4,399
Thanks: 8
Thanked 536 Times in 515 Posts
I think that is the wrong permissions for the dirs, but I am between ssh's. I recall having very specific permissions for both the files and the dirs. Once I get it right using "ssh2 localhost pwd", then I "scp2 -rpd .ssh* remote:.", and everything works there that works here except, ironically enough, localhost and 127.0.0.1, as the local key is changed, but it tells you what line to remove/update.

http://prefetch.net/blog/index.php/2...missions-bite/
Sponsored Links
    #3  
Old 12-20-2010
maverick_here maverick_here is offline
Registered User
 
Join Date: May 2009
Last Activity: 5 August 2014, 2:46 PM EDT
Location: Hyderabad
Posts: 127
Thanks: 0
Thanked 5 Times in 4 Posts
Issue is now resolved

Finally the issue is now resolved.It was a permissions issue.I noticed later that home directories of the users having issues for some reason were globally writable.I realized it when I initialed a strace. I have changed the permissions to 700 and it works as a charm.

Thank you all for your valuable time and feedback
Syed
    #4  
Old 12-20-2010
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 26 August 2014, 2:11 PM EDT
Location: Southern NJ, USA (Nord)
Posts: 4,399
Thanks: 8
Thanked 536 Times in 515 Posts
Yeah, the fussy permissions without a warning message thing is a bear!
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What are public keys in ssh and how do we create the public keys?? ravi3cha Shell Programming and Scripting 1 09-01-2010 01:39 AM
Public Key Authentication over SSH and Sudo-ing Implementation tristanD UNIX for Dummies Questions & Answers 1 05-14-2010 02:37 AM
LDAP user authentication issue j_aix AIX 4 11-11-2009 12:34 PM
Sftp Key Authentication Issue SteveBurch UNIX for Advanced & Expert Users 3 05-28-2009 11:27 AM
SSH - Public key rahulrathod UNIX for Advanced & Expert Users 6 05-31-2007 10:37 AM



All times are GMT -4. The time now is 12:55 PM.