I'm attempting to set up a git repository on our office server and make it accessible through SSH using public key authentication. I created a user git
on the server and added two OpenSSH public keys to ~/.ssh/authorized_users
.
I'm able to successfully connect using ssh git@xxx.xxx.xxx.xxx
. When trying to connect with ssh ssh://git@xxx.xxx.xxx.xxx
the public key authentication fails and the connection falls back on password authentication; however, the git user's password doesn't authenticate either. This same also holds when trying to connect as from a different user on the sever (ssh ssh://git@localhost
).
Does anyone know a manner of configuration that might cause this behaviour?
The server is a Mac Mini running OSX 10.6.8 with the default OpenSSH installed.
The messages in /var/log/secure.log
are as follows:
$ grep 'sshd' /var/log/secure.log
// Accepted connections
Accepted publickey for git from xxx.xxx.xxx.xxx port 51818 ssh2
Accepted publickey for git from 127.0.0.1 port 49305 ssh2
// Failed connections
Invalid user ssh from xxx.xxx.xxx.xxx
in pam_sm_authenticate(): Failed to determine Kerberos principal name.
error: PAM: authentication error for illegal user ssh from xxx.xxx.xxx.xxx via yyy.yyy.yyy.yyy
Failed keyboard-interactive/pam for invalid user ssh from xxx.xxx.xxx.xxx port 58526 ssh2
The verbose output when successfully connecting from the client:
$ ssh -v git@xxx.xxx.xxx.xxx
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /c/Users/xxxxxx/.ssh/config
debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file /c/Users/xxxxxx/.ssh/identity type -1
debug1: identity file /c/Users/xxxxxx/.ssh/id_rsa type 1
debug1: identity file /c/Users/xxxxxx/.ssh/id_dsa type 1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2
debug1: match: OpenSSH_5.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
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 'xxx.xxx.xxx.xxx' is known and matches the RSA host key.
debug1: Found key in /c/Users/xxxxxx/.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,gssapi-keyex,gssapi-with-mic,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/xxxxxx/.ssh/identity
debug1: Offering public key: /c/Users/xxxxxx/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
The verbose output when client connection fails:
$ ssh -v ssh://git@xxx.xxx.xxx.xxx
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /c/Users/xxxxxx/.ssh/config
debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file /c/Users/xxxxxx/.ssh/identity type -1
debug1: identity file /c/Users/xxxxxx/.ssh/id_rsa type 1
debug1: identity file /c/Users/xxxxxx/.ssh/id_dsa type 1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.2
debug1: match: OpenSSH_5.2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
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 'xxx.xxx.xxx.xxx' is known and matches the RSA host key.
debug1: Found key in /c/Users/xxxxxx/.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,gssapi-keyex,gssapi-with-mic,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Users/xxxxxx/.ssh/identity
debug1: Offering public key: /c/Users/xxxxxx/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive
debug1: Offering public key: /c/Users/xxxxxx/.ssh/id_dsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
Password:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive
Password:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive
Password:
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).