OpenSSH Server Not Reading authorized_keys
I've got a completely fresh install of Ubuntu 12.04 and installed OpenSSH as part of the OS installation. SSH is working, but not with public key authentication.
I've verified that the file permissions are correct (several times), but running a stat on authorized_keys shows that sshd is never reading the file. I've also turned strictmodes off as a diagnostic step, but that didn't solve anything either.
stat output:
File: `.ssh/authorize
Size: 397 Blocks: 8 IO Block: 4096 regular file
Device: fc00h/64512d Inode: 5898265 Links: 1
Access: (0600/-rw-------) Uid: ( 1000/ dagan) Gid: ( 1000/ dagan)
Access: 2012-05-12 13:43:09.347773631 -0700
Modify: 2012-05-12 13:42:46.519772851 -0700
Change: 2012-05-12 13:42:46.523772828 -0700
Here are my config file and a debug log:
=======
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/
#ListenAddress ::
ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/
HostKey /etc/ssh/
HostKey /etc/ssh/
#Privilege Separation is turned on for security
UsePrivilegeSep
# Lifetime and size of ephemeral version 1 server key
KeyRegeneration
ServerKeyBits 768
# Logging
SyslogFacility AUTH
LogLevel DEBUG
# Authentication:
LoginGraceTime 120
PermitRootLogin no
StrictModes no
RSAAuthentication yes
PubkeyAuthentic
AuthorizedKeysFile %h/.ssh/
# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_
RhostsRSAAuthen
# similar for protocol version 2
HostbasedAuthen
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthen
#IgnoreUserKnow
# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPass
# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeRespon
# Change to no to disable tunnelled clear text passwords
PasswordAuthent
# Kerberos options
#KerberosAuthen
#KerberosGetAFS
#KerberosOrLoca
#KerberosTicket
# GSSAPI options
#GSSAPIAuthenti
#GSSAPICleanupC
X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no
#MaxStartups 10:30:60
#Banner /etc/issue.net
# Allow client to pass locale environment variables
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/
# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeRespon
# PasswordAuthent
# PAM authentication via ChallengeRespon
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthent
# and ChallengeRespon
UsePAM yes
DEBUG LOG:
--------------
May 13 12:48:59 gemma sshd[23242]: Set /proc/self/
May 13 12:48:59 gemma sshd[23242]: debug1: Bind to port 22 on 0.0.0.0.
May 13 12:48:59 gemma sshd[23242]: Server listening on 0.0.0.0 port 22.
May 13 12:49:08 gemma sshd[23242]: debug1: Forked child 23243.
May 13 12:49:08 gemma sshd[23243]: Set /proc/self/
May 13 12:49:08 gemma sshd[23243]: debug1: rexec start in 4 out 4 newsock 4 pipe 6 sock 7
May 13 12:49:08 gemma sshd[23243]: debug1: inetd sockets after dupping: 3, 3
May 13 12:49:08 gemma sshd[23243]: Connection from 10.0.0.102 port 57593
May 13 12:49:08 gemma sshd[23243]: debug1: Client protocol version 2.0; client software version PuTTY_Release_0.62
May 13 12:49:08 gemma sshd[23243]: debug1: no match: PuTTY_Release_0.62
May 13 12:49:08 gemma sshd[23243]: debug1: Enabling compatibility mode for protocol 2.0
May 13 12:49:08 gemma sshd[23243]: debug1: Local version string SSH-2.0-
May 13 12:49:08 gemma sshd[23243]: debug1: permanently_
May 13 12:49:08 gemma sshd[23243]: debug1: list_hostkey_types: ssh-rsa,
May 13 12:49:08 gemma sshd[23243]: debug1: SSH2_MSG_KEXINIT sent [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: SSH2_MSG_KEXINIT received [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: kex: client->server aes256-ctr hmac-sha1 none [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: kex: server->client aes256-ctr hmac-sha1 none [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: SSH2_MSG_
May 13 12:49:08 gemma sshd[23243]: debug1: SSH2_MSG_
May 13 12:49:08 gemma sshd[23243]: debug1: expecting SSH2_MSG_
May 13 12:49:08 gemma sshd[23243]: debug1: SSH2_MSG_
May 13 12:49:08 gemma sshd[23243]: debug1: SSH2_MSG_NEWKEYS sent [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: expecting SSH2_MSG_NEWKEYS [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: SSH2_MSG_NEWKEYS received [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: KEX done [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: userauth-request for user dagan service ssh-connection method none [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: attempt 0 failures 0 [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: PAM: initializing for "dagan"
May 13 12:49:08 gemma sshd[23243]: debug1: PAM: setting PAM_RHOST to "dagan"
May 13 12:49:08 gemma sshd[23243]: debug1: PAM: setting PAM_TTY to "ssh"
May 13 12:49:08 gemma sshd[23243]: debug1: userauth-request for user dagan service ssh-connection method publickey [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: attempt 1 failures 0 [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: test whether pkalg/pkblob are acceptable [preauth]
May 13 12:49:08 gemma sshd[23243]: debug1: Checking blacklist file /usr/share/
May 13 12:49:08 gemma sshd[23243]: debug1: Checking blacklist file /etc/ssh/
May 13 12:49:08 gemma sshd[23243]: debug1: temporarily_
May 13 12:49:08 gemma sshd[23243]: debug1: trying public key file /home/dagan/
May 13 12:49:08 gemma sshd[23243]: debug1: fd 4 clearing O_NONBLOCK
May 13 12:49:08 gemma sshd[23243]: debug1: restore_uid: 0/0
May 13 12:49:08 gemma sshd[23243]: Failed publickey for dagan from 10.0.0.102 port 57593 ssh2
May 13 12:49:11 gemma sshd[23243]: debug1: userauth-request for user dagan service ssh-connection method password [preauth]
May 13 12:49:11 gemma sshd[23243]: debug1: attempt 2 failures 1 [preauth]
May 13 12:49:11 gemma sshd[23243]: debug1: PAM: password authentication accepted for dagan
May 13 12:49:11 gemma sshd[23243]: debug1: do_pam_account: called
May 13 12:49:11 gemma sshd[23243]: Accepted password for dagan from 10.0.0.102 port 57593 ssh2
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Ubuntu openssh Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Dagan Henderson
- Solved:
- Last query:
- Last reply: