LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-03-2007, 08:48 PM   #1
dcroxton
Member
 
Registered: Apr 2004
Distribution: Ubuntu Jaunty
Posts: 64

Rep: Reputation: 16
Passwordless ssh isn't


I'm having no luck configuring passwordless ssh on an Ubuntu client. Actually, I have it working for root -- so something must be working -- but not for my main user. I've discovered several setup issues and fixed them, but there is obviously some other problem that I haven't discovered.

Steps so far:
* generated ida_dsa.pub, copied it to remote host ~/.ssh/authorized_keys and set permissions to 600
* set GSSAPIAuthentication no on the client
* set EnableSSHKeysign yes on the client
* copied ~/.ssh/id_dsa to ~/.ssh/identity (no idea if this was needed, but it kept saying it couldn't find an identity, so I figured I would try it)
* run ssh-add

Here's the output from ssh -vvv [host] (the most important stuff is at the very bottom):

Code:
OpenSSH_4.3p2 Debian-8ubuntu1, OpenSSL 0.9.8c 05 Sep 2006
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to ox [192.168.2.3] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /home/dcroxton/.ssh/identity.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/dcroxton/.ssh/identity type -1
debug1: identity file /home/dcroxton/.ssh/id_rsa type -1
debug3: Not a RSA1 key file /home/dcroxton/.ssh/id_dsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /home/dcroxton/.ssh/id_dsa type 2
debug1: Remote protocol version 2.0, remote software version OpenSSH_3.8.1p1 Debian 1:3.8.1p1-5
debug1: match: OpenSSH_3.8.1p1 Debian 1:3.8.1p1-5 pat OpenSSH_3.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3p2 Debian-8ubuntu1
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,arcfour256,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc,rijndael-cbc@lysator.liu.se,aes128-ctr,aes192-ctr,aes256-ctr
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: none,zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_init: found hmac-md5
debug1: kex: server->client aes128-cbc hmac-md5 none
debug2: mac_init: found hmac-md5
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
debug2: dh_gen_key: priv key bits set: 153/256
debug2: bits set: 528/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: filename /home/dcroxton/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 6
debug3: check_host_in_hostfile: filename /home/dcroxton/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host 'ox' is known and matches the RSA host key.
debug1: Found key in /home/dcroxton/.ssh/known_hosts:6
debug2: bits set: 509/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /home/dcroxton/.ssh/id_dsa (0x800544d8)
debug2: key: /home/dcroxton/.ssh/id_dsa (0x80059000)
debug2: key: /root/.ssh/id_dsa (0x800595f0)
debug2: key: /home/dcroxton/.ssh/identity ((nil))
debug2: key: /home/dcroxton/.ssh/id_rsa ((nil))
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred hostbased,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /home/dcroxton/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /home/dcroxton/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: /root/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/dcroxton/.ssh/identity
debug1: PEM_read_PrivateKey failed
debug1: read PEM private key done: type <unknown>
Enter passphrase for key '/home/dcroxton/.ssh/identity': 
debug1: read PEM private key done: type DSA
debug3: sign_and_send_pubkey
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/dcroxton/.ssh/id_rsa
debug3: no such identity: /home/dcroxton/.ssh/id_rsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:
As you can see, it is asking me for the passphrase, which it shouldn't because I have already added it; and even when I enter it, that method is failing and I still have to enter a password (which does finally work).
I've scoured the net for help on this, but so far I haven't been able to find out what I'm doing wrong. Please help!
 
Old 09-03-2007, 11:47 PM   #2
leandean
Member
 
Registered: Oct 2005
Location: Burley, WA
Distribution: Sabayon
Posts: 276

Rep: Reputation: Disabled
no such identity: /home/dcroxton/.ssh/id_rsa

It can't find the private key to authenticate against.
 
Old 09-04-2007, 08:01 AM   #3
dcroxton
Member
 
Registered: Apr 2004
Distribution: Ubuntu Jaunty
Posts: 64

Original Poster
Rep: Reputation: 16
I generated id_dsa keys, not id_rsa. What do I need to do to get it to recognize id_dsa (or to generate id_rsa keys, if necessary)?
 
Old 09-04-2007, 09:06 PM   #4
dcroxton
Member
 
Registered: Apr 2004
Distribution: Ubuntu Jaunty
Posts: 64

Original Poster
Rep: Reputation: 16
I managed to solve this after poking around some more. I could never find a log file for ssh, but then I read somewhere to check in auth.log. There I found that the permissions on my home directory were wrong. I had checked the permissions on .ssh and on authorized_keys, but not my home directory! Apparently I had mucked around with them sometime and changed them. Once I reset them to 755, it worked fine.

Thanks for the help.
 
Old 07-17-2008, 10:13 PM   #5
rob0t
Member
 
Registered: Jun 2003
Location: Chicago
Distribution: Arch, CentOS, Ubuntu, FreeBSD, Solaris / OpenIndiana
Posts: 95

Rep: Reputation: 16
Ah, glad that this problem was solved. Thanks for posting the solution, turns out my home directory wasn't 755 either.

Thanks again.
 
Old 07-17-2008, 10:15 PM   #6
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 197Reputation: 197
Quote:
Originally Posted by dcroxton View Post
I managed to solve this after poking around some more. I could never find a log file for ssh, but then I read somewhere to check in auth.log. There I found that the permissions on my home directory were wrong. I had checked the permissions on .ssh and on authorized_keys, but not my home directory! Apparently I had mucked around with them sometime and changed them. Once I reset them to 755, it worked fine.

Thanks for the help.
SSH keys in fact are very picky about the permissions, which makes sense. Anything dealing with passwords should be very picky about permissions.
 
Old 07-17-2008, 10:34 PM   #7
rob0t
Member
 
Registered: Jun 2003
Location: Chicago
Distribution: Arch, CentOS, Ubuntu, FreeBSD, Solaris / OpenIndiana
Posts: 95

Rep: Reputation: 16
Quote:
Originally Posted by trickykid View Post
SSH keys in fact are very picky about the permissions, which makes sense. Anything dealing with passwords should be very picky about permissions.
A picky bunch, though one would think debug would show ya something about it

Had to dig deeper than that.

Last edited by rob0t; 07-17-2008 at 10:35 PM.
 
Old 07-18-2008, 06:17 AM   #8
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Lenny/Squeeze/Wheezy/Sid
Posts: 4,086

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
It is recommended not to allow ssh access as root. It is allowed by default in Debian and as I understand it, in Ubuntu as well.

It is better to disable ssh access as root, log in as a normal user and su to root.

jlinkels
 
Old 07-18-2008, 12:16 PM   #9
rob0t
Member
 
Registered: Jun 2003
Location: Chicago
Distribution: Arch, CentOS, Ubuntu, FreeBSD, Solaris / OpenIndiana
Posts: 95

Rep: Reputation: 16
As far as I know, it's pretty much allowed in any distro that I've used so far (Ubuntu, Slackware, Gentoo, Fedora, etc)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't use passwordless ssh sunhui Linux - Security 1 10-03-2006 08:29 PM
ssh passwordless question matticus Linux - Newbie 4 07-12-2006 03:45 AM
Passwordless SSH with SSH commercial server and open ssh cereal83 Linux - General 7 04-18-2006 12:34 PM
Ssh passwordless : Urgent muneebs123 Linux - Security 23 06-21-2005 08:26 PM
Regarding Passwordless SSH nedian123 Linux - Software 1 08-05-2004 05:07 PM


All times are GMT -5. The time now is 02:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration