Ich bin verwirrt darüber, was dieser Talkback bedeutet, wenn ich sshing bin."Anbieten RSA öffentlichen Schlüssel:" findet nicht den richtigen Schlüssel während ssh zu meiner AWS-Instanz
Ich fühle mich wie wenn ich es versteht, kann ich das Problem lösen könnte das ich habe, das ist, ich bin immer
debug1: No more authentication methods to try. Permission denied (publickey).
Hier ist der Talkback-:
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.com,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).
die erste Die fett gedruckte Zeile zeigt an, dass ssh versucht, einen privaten Schlüssel anzubieten, key_A
. Aber key_A ist ein anderer Schlüssel, der sich auf einen völlig anderen Server bezieht. Es hat nichts mit der AWS-Instanz zu tun, auf die ich zugreifen möchte.
Die zweite fett gedruckte Zeile findet den richtigen Schlüssel, key_B
. Aber warte, es ist ein privater Schlüssel? Dies ist der Schlüssel, den ich von der AWS-Konsole erzeugt habe und versuche, ihn zu verwenden, wenn ich mich anmelde.
Warum versucht ssh zuerst auf einen zufälligen öffentlichen Schlüssel zuzugreifen, beginnt er sich später nach einem privaten Schlüssel umzusehen? Es findet nicht den richtigen öffentlichen Schlüssel.
Mein ssh ist:
ssh -i /me/somedir/key_B.pem [email protected]
Warum wird nicht ssh Blick an der richtigen Stelle?
Vielen Dank im Voraus.
ok, ich poste das ganze Protokoll ... –
Ich habe keine Konfigurationsdatei bei '~/.ssh', nur' authorized_keys' und 'known-hosts' Verzeichnisse. Vielen Dank für deine Hilfe!! –
Verwenden Sie '-vvv', um ein ausführlicheres Protokoll zu erhalten. Die Information ist wahrscheinlich in den ausführlicheren Protokollen verborgen. Sie suchen nach IdentityFile-Optionen, aber der Kontext ist wichtig. Schauen Sie sich auch die '/ etc/ssh/ssh_config' an. – Jakuje