title: gerrit throwing an gerrit@localhost: Permission denied (publickey) error
body: <p>I have setup the Gerrit using docker-compose.</p>
  <p>ref doc: <a href="https://github.com/GerritCodeReview/docker-gerrit" rel="nofollow noreferrer">https://github.com/GerritCodeReview/docker-gerrit</a></p>
  <p>I am trying to login on the Gerrit server using SSH protocol.
  http is working fine. but i need ssh as well for jenkins</p>
  <p>ssh -vv -p 29418 localhost</p>
  <p>logs:</p>
  <pre><code>[gerrit@957ec687d4a3 ~]$ ssh -vv -p 29418 localhost
  OpenSSH_8.0p1, OpenSSL 1.1.1c FIPS  28 May 2019
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
  debug2: checking match for 'final all' host localhost originally localhost
  debug2: match not found
  debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
  debug1: configuration requests final Match pass
  debug1: re-parsing configuration
  debug1: Reading configuration data /etc/ssh/ssh_config
  debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
  debug2: checking match for 'final all' host localhost originally localhost
  debug2: match found
  debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
  debug2: resolving &quot;localhost&quot; port 29418
  debug2: ssh_connect_direct
  debug1: Connecting to localhost [127.0.0.1] port 29418.
  debug1: Connection established.
  debug1: identity file /var/gerrit/.ssh/id_rsa type 0
  debug1: identity file /var/gerrit/.ssh/id_rsa-cert type -1
  debug1: identity file /var/gerrit/.ssh/id_dsa type -1
  debug1: identity file /var/gerrit/.ssh/id_dsa-cert type -1
  debug1: identity file /var/gerrit/.ssh/id_ecdsa type -1
  debug1: identity file /var/gerrit/.ssh/id_ecdsa-cert type -1
  debug1: identity file /var/gerrit/.ssh/id_ed25519 type -1
  debug1: identity file /var/gerrit/.ssh/id_ed25519-cert type -1
  debug1: identity file /var/gerrit/.ssh/id_xmss type -1
  debug1: identity file /var/gerrit/.ssh/id_xmss-cert type -1
  debug1: Local version string SSH-2.0-OpenSSH_8.0
  debug1: Remote protocol version 2.0, remote software version GerritCodeReview_3.3.3 (APACHE-SSHD-2.4.0)
  debug1: no match: GerritCodeReview_3.3.3 (APACHE-SSHD-2.4.0)
  debug2: fd 3 setting O_NONBLOCK
  debug1: Authenticating to localhost:29418 as 'gerrit'
  debug1: SSH2_MSG_KEXINIT sent
  debug1: SSH2_MSG_KEXINIT received
  debug2: local client KEXINIT proposal
  debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,ext-info-c
  debug2: host key algorithms: ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
  debug2: ciphers ctos: aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc,3des-cbc
  debug2: ciphers stoc: aes256-gcm@openssh.com,chacha20-poly1305@openssh.com,aes256-ctr,aes256-cbc,aes128-gcm@openssh.com,aes128-ctr,aes128-cbc,3des-cbc
  debug2: MACs ctos: umac-128-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128@openssh.com,hmac-sha1,hmac-sha2-256,hmac-sha2-512
  debug2: MACs stoc: umac-128-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,umac-128@openssh.com,hmac-sha1,hmac-sha2-256,hmac-sha2-512
  debug2: compression ctos: none,zlib@openssh.com,zlib
  debug2: compression stoc: none,zlib@openssh.com,zlib
  debug2: languages ctos:
  debug2: languages stoc:
  debug2: first_kex_follows 0
  debug2: reserved 0
  debug2: peer server KEXINIT proposal
  debug2: KEX algorithms: ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group18-sha512,diffie-hellman-group17-sha512,diffie-hellman-group16-sha512,diffie-hellman-group15-sha512,diffie-hellman-group14-sha256,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
  debug2: host key algorithms: ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
  debug2: ciphers ctos: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
  debug2: ciphers stoc: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc
  debug2: MACs ctos: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
  debug2: MACs stoc: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1,hmac-md5,hmac-sha1-96,hmac-md5-96
  debug2: compression ctos: none
  debug2: compression stoc: none
  debug2: languages ctos:
  debug2: languages stoc:
  debug2: first_kex_follows 0
  debug2: reserved 0
  debug1: kex: algorithm: ecdh-sha2-nistp256
  debug1: kex: host key algorithm: ecdsa-sha2-nistp256
  debug1: kex: server-&gt;client cipher: aes256-ctr MAC: hmac-sha1-etm@openssh.com compression: none
  debug1: kex: client-&gt;server cipher: aes256-ctr MAC: hmac-sha1-etm@openssh.com compression: none
  debug1: kex: ecdh-sha2-nistp256 need=32 dh_need=32
  debug1: kex: ecdh-sha2-nistp256 need=32 dh_need=32
  debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
  debug1: Server host key: ecdsa-sha2-nistp256 SHA256:QJIkQCiy/Pi43QI2H6A9OBVOY4f+7tpIK+W+Nwi2C6g
  debug1: Host '[localhost]:29418' is known and matches the ECDSA host key.
  debug1: Found key in /var/gerrit/.ssh/known_hosts:1
  debug2: set_newkeys: mode 1
  debug1: rekey out after 4294967296 blocks
  debug1: SSH2_MSG_NEWKEYS sent
  debug1: expecting SSH2_MSG_NEWKEYS
  debug1: SSH2_MSG_NEWKEYS received
  debug2: set_newkeys: mode 0
  debug1: rekey in after 4294967296 blocks
  debug1: Will attempt key: /var/gerrit/.ssh/id_rsa RSA SHA256:dBSjzg5IkLz0ShVN2T2ig8S+VuEB2/Qf4/l4t6YPv+Y
  debug1: Will attempt key: /var/gerrit/.ssh/id_dsa
  debug1: Will attempt key: /var/gerrit/.ssh/id_ecdsa
  debug1: Will attempt key: /var/gerrit/.ssh/id_ed25519
  debug1: Will attempt key: /var/gerrit/.ssh/id_xmss
  debug2: pubkey_prepare: done
  debug2: service_accept: ssh-userauth
  debug1: SSH2_MSG_SERVICE_ACCEPT received
  debug1: Authentications that can continue: publickey
  debug1: Next authentication method: publickey
  debug1: Offering public key: /var/gerrit/.ssh/id_rsa RSA SHA256:dBSjzg5IkLz0ShVN2T2ig8S+VuEB2/Qf4/l4t6YPv+Y
  debug2: we sent a publickey packet, wait for reply
  debug1: Authentications that can continue: publickey
  debug1: Trying private key: /var/gerrit/.ssh/id_dsa
  debug1: Trying private key: /var/gerrit/.ssh/id_ecdsa
  debug1: Trying private key: /var/gerrit/.ssh/id_ed25519
  debug1: Trying private key: /var/gerrit/.ssh/id_xmss
  debug2: we did not send a packet, disable method
  debug1: No more authentication methods to try.
  gerrit@localhost: Permission denied (publickey).
  </code></pre>
  <p>I am trying these scenario inside the Gerrit container</p>
  <p>please someone help on this isssue,</p>
  <p>you can see in the below image add ssh key button is disable. I am not able
  add the key.</p>
  <p><a href="https://i.stack.imgur.com/IhFDq.png%5D" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IhFDq.png%5D" alt="enter image description here" /></a></p>