I used the official guide to install Gerrit on a Debian server. Now I am stuck at the paragraph where I am supposed to verify that the ssh connection works:
ssh bastian@ip.of.the.server -p 29418 <-- home pc to server
This is my situation: On my home PC I have a user account bastian
and I generated a key pair for ssh. On the server there is a root account: root
, an account for gerrit: gerrit2
, and, again, the account bastian
. I added the public key into the web interface of gerrit after login in with OpenID. By advise I also added the public key to /root/.ssh/authorized_keys
and /home/bastian/.ssh/authorized_keys
(on the server). Then I created the file /home/gerrit2/.ssh/config/
(on the server) with the content:
IdentityFile ~/.ssh/id_rsa
Checking the ssh connection verbosely results in:
OpenSSH_6.0p1 Debian-3ubuntu1, OpenSSL 1.0.1c 10 May 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 130.83.160.104 [130.83.160.104] port 29418.
debug1: Connection established.
debug1: identity file /home/bastian/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/bastian/.ssh/id_rsa-cert type -1
debug1: identity file /home/bastian/.ssh/id_dsa type -1
debug1: identity file /home/bastian/.ssh/id_dsa-cert type -1
debug1: identity file /home/bastian/.ssh/id_ecdsa type -1
debug1: identity file /home/bastian/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version GerritCodeReview_2.5.4 (SSHD-CORE-0.5.1-R1095809)
debug1: no match: GerritCodeReview_2.5.4 (SSHD-CORE-0.5.1-R1095809)
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-3ubuntu1
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: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: RSA e9:fc:38:b3:86:f6:72:47:de:79:59:ba:c6:c6:de:7e
debug1: Host '[130.83.160.104]:29418' is known and matches the RSA host key.
debug1: Found key in /home/bastian/.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: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/bastian/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/bastian/.ssh/id_dsa
debug1: Trying private key: /home/bastian/.ssh/id_ecdsa
debug1: No more authentication methods to try.
Permission denied (publickey).