2017-04-21 2 views
0

私はこのトークバックが何を意味するのか混乱しています。"提供するRSA公開鍵:"は、AWSインスタンスにsshの間に正しい鍵を見つけられません

私はそれを理解することができれば、私はある、私がいる問題を解決できるように感じる、私は
debug1: No more authentication methods to try. Permission denied (publickey).

を取得しています。ここトークバックです:

OpenSSH_6.9p1, LibreSSL 2.1.8 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 21: Applying options for * 
debug2: ssh_connect: needpriv 0 
debug1: Connecting to ec2-xx-xx-x-xx.us-west-2.compute.amazonaws.com [xx.xx.x.xx] port 22. 
debug1: Connection established. 
debug1: key_load_public: No such file or directory 
debug1: identity file /me/key_B.pem type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file /me/key_Bt type -1 
debug1: Enabling compatibility mode for protocol 2.0 
debug1: Local version string SSH-2.0-OpenSSH_6.9 
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.1 pat OpenSSH* compat 0x04000000 
debug2: fd 3 setting O_NONBLOCK 
debug1: Authenticating to ec2-xx-xx-x-xx.us-west-2.compute.amazonaws.com:22 as 'ec2-user' 
debug3: hostkeys_foreach: reading file "/me/.ssh/known_hosts" 
debug3: record_hostkey: found key type ECDSA in file /me/.ssh/known_hosts:9 
debug3: load_hostkeys: loaded 1 keys from ec2-xx-xx-x-xx.us-west-2.compute.amazonaws.com 
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-nistp256,ecdsa-nistp384,ecdsa-nistp521 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug2: kex_parse_kexinit: [email protected],ecdh-nistp256,ecdh-nistp384,ecdh-nistp521,diffie-hellman-group-exchange-56,diffie-hellman-group-exchange-1,diffie-hellman-group14-sha1,diffie-hellman-group1- 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-nistp256,ecdsa-sha2-nistp384,ecdsa-nistp521,[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed,ssh-rsa,ssh-dss 
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],arc256,arc128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arc,[email protected] 
debug2: kex_parse_kexinit: [email protected],aes-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1,[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1,[email protected],[email protected],[email protected],[email protected],hmac-md5,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
debug2: kex_parse_kexinit: none,[email protected],zlib 
debug2: kex_parse_kexinit: none,[email protected],zlib 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1 
debug2: kex_parse_kexinit: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected] 
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected] 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1 
debug2: kex_parse_kexinit: none,[email protected] 
debug2: kex_parse_kexinit: none,[email protected] 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug1: kex: server->client [email protected] <implicit> none 
debug1: kex: client->server [email protected] <implicit> none 
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY 
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:OWvg35+ziszO+1muZwu+vwk8awGkedK4/N7iAy4l93A 
debug3: hostkeys_foreach: reading file "me/.ssh/known_hosts" 
debug3: record_hostkey: found key type ECDSA in file /me/.ssh/known_hosts:9 
debug3: load_hostkeys: loaded 1 keys from ec2-xx-xx-x-xx.us-east-2.compute.amazonaws.com 
debug3: hostkeys_foreach: reading file "/me/.ssh/known_hosts" 
debug3: record_hostkey: found key type ECDSA in file /me/.ssh/known_hosts:9 
debug3: load_hostkeys: loaded 1 keys from 52.43.3.81 
debug1: Host 'ec2-xx-xx-x-xx.us-west-2.compute.amazonaws.com' is known and matches the ECDSA host key. 
debug1: Found key in /me/.ssh/known_hosts:9 
debug2: set_newkeys: mode 1 
debug1: SSH2_MSG_NEWKEYS sent 
debug1: expecting SSH2_MSG_NEWKEYS 
debug2: set_newkeys: mode 0 
debug1: SSH2_MSG_NEWKEYS received 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug2: service_accept: ssh-userauth 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug2: key: me/.ssh/mobrien_mac_20161019 (0x7f9da3f00080), 
debug2: key: /Users/matthewobrien/Dropbox/key_B (0x0), explicit 
debug1: Authentications that can continue: publickey 
debug3: start over, passed a different list publickey 
debug3: preferred publickey,keyboard-interactive,password 
debug3: authmethod_lookup publickey 
debug3: remaining preferred: keyboard-interactive,password 
debug3: authmethod_is_enabled publickey 
debug1: Next authentication method: publickey 
**debug1: Offering RSA public key: /me/.ssh/key_A** 
debug3: send_pubkey_test 
debug2: we sent a publickey packet, wait for reply 
debug1: Authentications that can continue: publickey 
**debug1: Trying private key: /me/key_B** 
debug3: sign_and_send_pubkey: RSA SHA256:WAZzLsdfdsfasdfaspTYXXXXXXiS4wzvTasdfasdfTB/q0B0 
debug2: we sent a publickey packet, wait for reply 
debug1: Authentications that can continue: publickey 
debug2: we did not send a packet, disable method 
debug1: No more authentication methods to try. 
Permission denied (publickey). 

最初太字の行は、sshが秘密鍵を提供しようとしていることを示しています(key_A)。しかし、key_Aはまったく異なるサーバーに関連する別のキーです。それは私がアクセスしようとしているAWSインスタンスとは関係ありません。

太字の2行目は、正しいキーが見つかっています(key_B)。しかし、待って、それはプライベートキーですか?これはAWSコンソールから生成した鍵で、ログイン時に使用しようとしています。

なぜsshは最初にランダムな公開鍵にアクセスしようとしているのですか?正しい公開鍵を見つけることができません。

私のsshがある:

ssh -i /me/somedir/key_B.pem [email protected]

なぜ右の場所で見てsshをしないのだろうか?

ありがとうございます。

答えて

0

おそらく実行するように設定されているので、なぜsshは最初のランダムな公開鍵、

にアクセスしようとしています。 ~/.ssh/configまたは/etc/ssh/ssh_configには何がありますか?

その後、秘密鍵の検索を開始しますか?正しい公開鍵を見つけることができません。

私のsshがある:

ssh -i /me/somedir/key_B.pem [email protected] 

はなぜ正しい場所に見てsshをしないのだろうか?

debug1: identity file /me/key_B.pem type -1 

それが鍵を理解していないため。それは間違ったフォーマットか何らかの形で壊れています。どんな風に見えますか?

+0

ok、私はログ全体を投稿します... –

+0

'〜/ .ssh'には、' authorized_keys'と 'known-hosts'ディレクトリの設定ファイルがありません。あなたの助けをありがとう! –

+0

'-vvv'を使用してより詳細なログを取得します。この情報はおそらくより詳細なログに隠されています。あなたは 'IdentityFile'オプションを探していますが、コンテキストは重要です。 '/ etc/ssh/ssh_config'も見てください。 – Jakuje

関連する問題