I recently got the Jenkins appliance running on Turnkey Hub. I tried connecting to a private git repository (I added my ssh key to the home directory of tomcat6 - which Jenkins runs under, added it to Jenkins and installed the ssh plugin, but so far I still haven't been able to connect). I even copied my known_hosts file from my system over to Jenkins, but I still keep getting the same error.
I changed the shell for the tomcat user to sh (it used to be /usr/false), and running
$ ssh -vT email@example.com OpenSSH_5.5p1 Debian-6+squeeze2, OpenSSL 0.9.8o 01 Jun 2010 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Applying options for bitbucket.org debug1: Connecting to bitbucket.org [22.214.171.124] port 22. debug1: Connection established. debug1: identity file /usr/share/tomcat6/.ssh/id_rsa type -1 debug1: identity file /usr/share/tomcat6/.ssh/id_rsa-cert type -1 debug1: identity file /usr/share/tomcat6/.ssh/id_dsa type -1 debug1: identity file /usr/share/tomcat6/.ssh/id_dsa-cert 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.5p1 Debian-6+squeeze2 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 Failed to add the host to the list of known hosts (/usr/share/tomcat6/.ssh/known_hosts). 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: Trying private key: /usr/share/tomcat6/.ssh/id_rsa debug1: Trying private key: /usr/share/tomcat6/.ssh/id_dsa debug1: No more authentication methods to try. Permission denied (publickey).
I'm at my wits end at the moment, and am considering either getting tomcat to run as root or making my repo public. What can I do to get this working?