# Permission denied (publickey,keyboard-interactive).

## carpman

having some issues with ssh key login

error on box trying to ssh to

/var/log/messages

```

Mar 29 17:17:16 othello sshd[20844]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=192.168.50.3  user=michael

Mar 29 17:17:18 othello sshd[20839]: error: PAM: Authentication failure for michael from 192.168.50.3

Mar 29 17:17:23 othello sshd[20839]: Accepted keyboard-interactive/pam for michael from 192.168.50.3 port 36377 ssh2

Mar 29 17:17:23 othello sshd[20839]: pam_unix(sshd:session): session opened for user michael by (uid=0)

Mar 29 17:18:54 othello sshd[20839]: pam_unix(sshd:session): session closed for user michael

Mar 29 17:19:43 othello sshd[20862]: Accepted keyboard-interactive/pam for michael from 192.168.50.3 port 60393 ssh2

Mar 29 17:19:43 othello sshd[20862]: pam_unix(sshd:session): session opened for user michael by (uid=0)

```

sshd_config

```

Port 22

Protocol 2

ServerKeyBits 2048

SyslogFacility AUTH

LogLevel INFO

LoginGraceTime 60

PermitRootLogin no

RSAAuthentication no

PubkeyAuthentication yes

AuthorizedKeysFile      .ssh/authorized_keys2

PasswordAuthentication no

PermitEmptyPasswords no

#PAMAuthenticationViaKbdInt no

Compression yes

KeepAlive yes

ClientAliveInterval 30

ClientAliveCountMax 4

```

```

ssh -v localhost

OpenSSH_5.3p1, OpenSSL 0.9.8l 5 Nov 2009

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: Connecting to localhost [192.168.1.5] port 22.

debug1: Connection established.

debug1: permanently_set_uid: 0/0

debug1: identity file /root/.ssh/identity type -1

debug1: identity file /root/.ssh/id_rsa type 1

debug1: identity file /root/.ssh/id_dsa type -1

debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3

debug1: match: OpenSSH_5.3 pat OpenSSH*

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_5.3

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: server->client aes128-ctr hmac-md5 none

debug1: kex: client->server aes128-ctr 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 'localhost' is known and matches the RSA host key.

debug1: Found key in /root/.ssh/known_hosts:10

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,keyboard-interactive

debug1: Next authentication method: publickey

debug1: Trying private key: /root/.ssh/identity

debug1: Offering public key: /root/.ssh/id_rsa

debug1: Authentications that can continue: publickey,keyboard-interactive

debug1: Trying private key: /root/.ssh/id_dsa

debug1: Next authentication method: keyboard-interactive

debug1: Authentications that can continue: publickey,keyboard-interactive

debug1: No more authentication methods to try.

Permission denied (publickey,keyboard-interactive).

```

```

/usr/sbin/sshd -d                                 

debug1: sshd version OpenSSH_5.3p1                              

debug1: read PEM private key done: type RSA

debug1: private host key: #0 type 1 RSA

debug1: read PEM private key done: type DSA

debug1: private host key: #1 type 2 DSA

debug1: rexec_argv[0]='/usr/sbin/sshd'

debug1: rexec_argv[1]='-d'

debug1: Bind to port 22 on 0.0.0.0.

Server listening on 0.0.0.0 port 22.

debug1: Bind to port 22 on ::.

Server listening on :: port 22.

debug1: Server will not fork when running in debugging mode.

debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8

debug1: inetd sockets after dupping: 3, 3

Connection from 192.168.50.3 port 55953

debug1: Client protocol version 2.0; client software version OpenSSH_5.1p1 Debian-6ubuntu2

debug1: match: OpenSSH_5.1p1 Debian-6ubuntu2 pat OpenSSH*

debug1: Enabling compatibility mode for protocol 2.0

debug1: Local version string SSH-2.0-OpenSSH_5.3

debug1: permanently_set_uid: 22/22

debug1: list_hostkey_types: ssh-rsa,ssh-dss

debug1: SSH2_MSG_KEXINIT sent

debug1: SSH2_MSG_KEXINIT received

debug1: kex: client->server aes128-cbc hmac-md5 none

debug1: kex: server->client aes128-cbc hmac-md5 none

debug1: SSH2_MSG_KEX_DH_GEX_REQUEST received

debug1: SSH2_MSG_KEX_DH_GEX_GROUP sent

debug1: expecting SSH2_MSG_KEX_DH_GEX_INIT

debug1: SSH2_MSG_KEX_DH_GEX_REPLY sent

debug1: SSH2_MSG_NEWKEYS sent

debug1: expecting SSH2_MSG_NEWKEYS

debug1: SSH2_MSG_NEWKEYS received

debug1: KEX done

debug1: userauth-request for user michael service ssh-connection method none

debug1: attempt 0 failures 0

debug1: userauth-request for user michael service ssh-connection method keyboard-interactive

debug1: attempt 1 failures 0

debug1: keyboard-interactive devs

debug1: auth2_challenge: user=michael devs=

debug1: kbdint_alloc: devices ''

Connection closed by 192.168.50.3

debug1: do_cleanup

debug1: do_cleanup

permission on authorized_keys2 is 600

Any ideas?

cheers

```

----------

## carpman

no worries a reboot cured it.

----------

