2016-04-20 7 views
-2

https://aws.amazon.com/marketplace/pp/B00NO1HJ56/ref=srh_res_product_title?ie=UTF8&sr=0-2&qid=1461119036279Githubパーミッションが拒否されました(publickey)間違ったディレクトリにSSHキーがありますか?私は最近、AWS EC2上で、このスタックをインストールした

インスタンスのシステムログは、SSH鍵がここにインストールされたことを言う:

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

私はGitHubのアカウントに公開鍵を追加し、 指紋が一致します。

リポジトリをクローンすると、私は以下を取得します。 許可が拒否されました(publickey)。

Githubのヘルプセクションから

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

私が実行します。ssh -vT [email protected]と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 for * 
debug1: /etc/ssh/ssh_config line 56: Applying options for * 
debug1: Connecting to 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 for 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' is known and matches the 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 that 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 to try. 

私は、SSHエージェントが/home/bitnami/.ssh/を探しているようですしかし、キーは/ etc/sshの中に位置しています

これは/home/bitnami/.sshの内容です

authorized_keys 
known_hosts 

そして、この私はキーがSSHエージェントに追加されているかどうか確認した場合、私が取得するの/ 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 

の内容は次のとおりです。

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

すると、これは単にで私の公開鍵を追加するだけです/ etc/ssh /をssh-agentを使ってssh-agentに追加すると、どこから見えるのか分かりますか?

なぜキーがホームディレクトリではなく/ etc/hostsにインストールされていないのか分かりません。

答えて

1

解決策は単に/ etc/sshのキーを無視することです。これらのキーは、インスタンスにアクセスするためにAWSによって使用され、ユーザーではなくシステムに属します。

だから、僕はbitnamiユーザーの新しい鍵を生成し、これらのキーは正しく、私は今のGithubからの私のレポを引くことができ/home/.ssh/

に座っています。

関連する問題