linux - Github Permission denied (publickey) SSH keys in wrong directory? -


i've installed stack on aws ec2: https://aws.amazon.com/marketplace/pp/b00no1hj56/ref=srh_res_product_title?ie=utf8&sr=0-2&qid=1461119036279

the instance's system log says ssh keys installed here:

generating public/private rsa key pair. identification has been saved in /etc/ssh/ssh_host_rsa_key. public key has been saved in /etc/ssh/ssh_host_rsa_key.pub. 

i have added public key github account , the fingerprints match.

when cloning repo get: permission denied (publickey).

from github section https://help.github.com/articles/error-permission-denied-publickey

i run: ssh -vt git@github.com , get:

openssh_6.6.1, openssl 1.0.1f 6 jan 2014 debug1: reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: applying options * debug1: /etc/ssh/ssh_config line 56: applying options * debug1: connecting github.com [192.30.252.122] port 22. debug1: connection established. debug1: identity file /home/bitnami/.ssh/id_rsa type -1 debug1: identity file /home/bitnami/.ssh/id_rsa-cert type -1 debug1: identity file /home/bitnami/.ssh/id_dsa type -1 debug1: identity file /home/bitnami/.ssh/id_dsa-cert type -1 debug1: identity file /home/bitnami/.ssh/id_ecdsa type -1 debug1: identity file /home/bitnami/.ssh/id_ecdsa-cert type -1 debug1: identity file /home/bitnami/.ssh/id_ed25519 type -1 debug1: identity file /home/bitnami/.ssh/id_ed25519-cert type -1 debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh-2.0-openssh_6.6.1p1 ubuntu-2ubuntu2.6 debug1: remote protocol version 2.0, remote software version libssh-0.7.0 debug1: no match: libssh-0.7.0 debug1: ssh2_msg_kexinit sent debug1: ssh2_msg_kexinit received debug1: kex: server->client aes128-ctr hmac-sha1 none debug1: kex: client->server aes128-ctr hmac-sha1 none debug1: sending ssh2_msg_kex_ecdh_init debug1: expecting ssh2_msg_kex_ecdh_reply debug1: server host key: rsa 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48 debug1: host 'github.com' known , matches rsa host key. debug1: found key in /home/bitnami/.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 can continue: publickey debug1: next authentication method: publickey debug1: trying private key: /home/bitnami/.ssh/id_rsa debug1: trying private key: /home/bitnami/.ssh/id_dsa debug1: trying private key: /home/bitnami/.ssh/id_ecdsa debug1: trying private key: /home/bitnami/.ssh/id_ed25519 debug1: no more authentication methods try. 

i seems ssh agent searching /home/bitnami/.ssh/ keys located in /etc/ssh

this contents of /home/bitnami/.ssh

authorized_keys known_hosts 

and contents of /etc/ssh

moduli ssh_host_dsa_key ssh_host_ecdsa_key.pub ssh_host_rsa_key ssh_config ssh_host_dsa_key.pub ssh_host_ed25519_key ssh_host_rsa_key.pub sshd_config ssh_host_ecdsa_key ssh_host_ed25519_key.pub ssh_import_id 

if check keys added ssh agent get:

$ ssh-add -l get: agent has no identities. 

is matter of adding public key in /etc/ssh/ ssh agent using ssh-add, knows look?

i don't understand why keys not installed in /etc/hosts rather home directory.

the solution ignore keys in /etc/ssh. these keys used aws access instance , belongs system rather user.

so generated new keys bitnami user , keys correctly sitting in /home/.ssh/

i can pull repo github.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -