Dan Perez on 2 May 2008 07:19:27 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] ssh key based authentication


I'm trying to ssh from vgcrdp to sprint.

I removed the sprint user's .ssh directory and recreated it and
repopulated the authorized_keys file with vgcrdp's public key and
still nothing.

cpucrpt1 # ls -ld ~sprint/.ssh
drwx------   2 sprint   other        512 May  2 10:04 /oradata/tmpsprint/.ssh
cpucrpt1 # ls -l ~sprint/.ssh
total 2
-rw-------   1 sprint   other        225 May  2 10:09 authorized_keys

Here is the output from sprint running "ssh -v -l vgcrdp cpucrpt1":
OpenSSH_3.7.1p2, SSH protocols 1.5/2.0, OpenSSL 0.9.7c 30 Sep 2003
debug1: Reading configuration data /opt/sfw/etc/ssh_config
debug1: Connecting to cpucrpt1 [10.128.109.37] port 22.
debug1: Connection established.
debug1: identity file /oradata/tmpsprint/.ssh/identity type -1
debug1: identity file /oradata/tmpsprint/.ssh/id_rsa type -1
debug1: identity file /oradata/tmpsprint/.ssh/id_dsa type 1
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.7.1p2
debug1: match: OpenSSH_3.7.1p2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.7.1p2
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 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
The authenticity of host 'cpucrpt1 (10.128.109.37)' can't be established.
RSA key fingerprint is 5a:41:25:dc:54:b1:9f:72:e1:b7:42:1e:50:9c:25:d3.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'cpucrpt1,10.128.109.37' (RSA) to the list of known hosts.
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: /oradata/tmpsprint/.ssh/identity
debug1: Trying private key: /oradata/tmpsprint/.ssh/id_rsa
debug1: Offering public key: /oradata/tmpsprint/.ssh/id_dsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
vgcrdp@cpucrpt1's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
Last login: Fri May  2 08:50:25 2008 from 216.83.186.59
vgcrdp@cpucrpt1:

And here is the output from vgcrdp trying:
OpenSSH_3.7.1p2, SSH protocols 1.5/2.0, OpenSSL 0.9.7c 30 Sep 2003
debug1: Reading configuration data /opt/sfw/etc/ssh_config
debug1: Connecting to cpucrpt1 [10.128.109.37] port 22.
debug1: Connection established.
debug1: identity file /export/home/vgcrdp/.ssh/identity type -1
debug1: identity file /export/home/vgcrdp/.ssh/id_rsa type 1
debug1: identity file /export/home/vgcrdp/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.7.1p2
debug1: match: OpenSSH_3.7.1p2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.7.1p2
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 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 'cpucrpt1' is known and matches the RSA host key.
debug1: Found key in /export/home/vgcrdp/.ssh/known_hosts:1
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: /export/home/vgcrdp/.ssh/identity
debug1: Offering public key: /export/home/vgcrdp/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /export/home/vgcrdp/.ssh/id_dsa
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
sprint@cpucrpt1's password:

And, just to make this email a little longer, here is the abbreviated
output from vgcrdp trying to ssh to vgcesv.
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: /export/home/vgcrdp/.ssh/identity
debug1: Offering public key: /export/home/vgcrdp/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 149
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
Last login: Fri May  2 08:50:44 2008 from 10.128.109.37




mark.baker@hxti.com wrote [05/02/08]:
> Hi Dan,
> 
> Usually when I see these types of problems it stems from the file 
> permissions on the .ssh directory and key files.   I usually start 
> debugging by logging in as one of the users that is having trouble using 
> the keys and trying to Ssh to a server with the -v flag, which will 
> almost always show you the problem right off the bat.
> 
> Mark
> 
> > -----Original Message-----
> > From: Dan Perez [mailto:dperez@sdf.lonestar.org]
> > Sent: Friday, May 02, 2008 9:53 AM
> > To: plug@lists.phillylinux.org
> > Subject: [PLUG] ssh key based authentication
> > 
> > Hi all,
> > 
> > I'm having an issue with ssh key based authentication on a solaris
> > box.  I'm trying to set it up so I can login in to numerous userids on
> > this box without a password.  I've created my rsa keys and put my
> > public keys in the users' authorized_keys files.  I can ssh without a
> > password to some of the users but not all of them and I can't find the
> > difference with the two sets of users.
> > 
> > The users that I can't ssh in to without a password are designated ftp
> > accounts, but I don't see anything that actually makes them ftp
> > accounts.  They still have valid shells and shell access.  I don't
> > think the accounts are locked.  The homedirs are in a different
> > location, /oradata, but the users have full access to their homedirs
> > and .ssh directories.
> > 
> > I would really appreciate some pointers as to where to look.
> > Thanks, dan
> > _____________________________________________________________________
> > ______
> > Philadelphia Linux Users Group         --        
> http://www.phillylinux.org
> > Announcements - 
> http://lists.phillylinux.org/mailman/listinfo/plug-announce
> > General Discussion  --   
> http://lists.phillylinux.org/mailman/listinfo/plug
> 
> 
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug