2016-06-11 3 views
0

Я знаю, что было задано много вопросов, таких как этот, но ни один из них, похоже, не помогает.Разрешение отклонено (publickey) на Amazon EC2 и не может получить доступ к серверу

Я добавил новых пользователей в свой экземпляр EC2 и попытался предоставить один доступ к SSH. Я, должно быть, что-то испортил, потому что теперь я больше не могу получить SSH-доступ из ЛЮБОЙ учетной записи. Я запускаю сервер Ubuntu и сегодня имею SSH'd, и он внезапно перестает работать.

Я нашел много разных исправлений, но никто из них не работал. Они включают в себя:

using ssh-keygen -R [server ip]

chmod 400 on the .pem file

attaching the EBS volume to a new instance

Другие сайты предполагает, что я испортил что-то с правами на /home папку на моем сервере. Но без доступа, как я могу исправить эти разрешения? Я пробовал так много вещей, что я начинаю чувствовать, что я просто делаю это хуже.

Для справки, когда я пытаюсь SSH с помощью ssh -i Wachtwoord.pem [email protected] -vvv я получаю следующий результат:

Wouters-MacBook-Pro:AWS Wouter$ ssh -i Wachtwoord.pem [email protected] -vvv 
OpenSSH_6.9p1, LibreSSL 2.1.8 
debug1: Reading configuration data /etc/ssh/ssh_config 
debug1: /etc/ssh/ssh_config line 20: Applying options for * 
debug1: /etc/ssh/ssh_config line 102: Applying options for * 
debug2: ssh_connect: needpriv 0 
debug1: Connecting to 52.30.172.181 [52.30.172.181] port 22. 
debug1: Connection established. 
debug1: key_load_public: No such file or directory 
debug1: identity file Wachtwoord.pem type -1 
debug1: key_load_public: No such file or directory 
debug1: identity file Wachtwoord.pem-cert 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_6.6.1p1 Ubuntu-2ubuntu2.6 
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6 pat OpenSSH_6.6.1* compat 0x04000000 
debug2: fd 3 setting O_NONBLOCK 
debug1: Authenticating to 52.30.172.181:22 as 'ubuntu' 
debug3: hostkeys_foreach: reading file "/Users/Wouter/.ssh/known_hosts" 
debug3: record_hostkey: found key type ECDSA in file /Users/Wouter/.ssh/known_hosts:12 
debug3: load_hostkeys: loaded 1 keys from 52.30.172.181 
debug3: order_hostkeyalgs: prefer hostkeyalgs: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521 
debug1: SSH2_MSG_KEXINIT sent 
debug1: SSH2_MSG_KEXINIT received 
debug2: kex_parse_kexinit: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 
debug2: kex_parse_kexinit: [email protected],[email protected],[email protected],ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected],[email protected],[email protected],[email protected],ssh-ed25519,ssh-rsa,ssh-dss 
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: [email protected],aes128-ctr,aes192-ctr,aes256-ctr,[email protected],[email protected],arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-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-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519 
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected]nssh.com,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,[email protected] 
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,[email protected],[email protected],[email protected],aes128-cbc,3des-cbc,blowfish-cbc,cast128-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],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,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],[email protected],[email protected],hmac-md5,hmac-sha1,[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96 
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:y+3H4AJRnfGSdk8J/dSFS9lfUGAblTObro2xkdzgLNQ 
debug3: hostkeys_foreach: reading file "/Users/Wouter/.ssh/known_hosts" 
debug3: record_hostkey: found key type ECDSA in file /Users/Wouter/.ssh/known_hosts:12 
debug3: load_hostkeys: loaded 1 keys from 52.30.172.181 
debug1: Host '52.30.172.181' is known and matches the ECDSA host key. 
debug1: Found key in /Users/Wouter/.ssh/known_hosts:12 
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: Roaming not allowed by server 
debug1: SSH2_MSG_SERVICE_REQUEST sent 
debug2: service_accept: ssh-userauth 
debug1: SSH2_MSG_SERVICE_ACCEPT received 
debug2: key: /Users/Wouter/.ssh/id_rsa (0x7ff692501620), 
debug2: key: Wachtwoord.pem (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: /Users/Wouter/.ssh/id_rsa 
debug3: send_pubkey_test 
debug2: we sent a publickey packet, wait for reply 
debug1: Authentications that can continue: publickey 
debug1: Trying private key: Wachtwoord.pem 
debug3: sign_and_send_pubkey: RSA SHA256:rGZNQr6kyFs9Io0CGwz3z4Tkd0weVOQBoVmyPUQsfvk 
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). 
+0

Вы потеряли доступ к Ubuntu пользователь тоже? – error2007s

+0

Да, похоже. Потому что я получаю сообщение об ошибке, которое я написал выше, когда пытаюсь подключиться с помощью пользователя ubuntu. –

+0

Попробуйте взять одну вещь с изображением этого экземпляра и запустить ее с помощью нового ключа, а затем попробовать, если это работает? – error2007s

ответ

1

Если вы знаете, что проблема связана с ключевыми парами, то вы можете:

  • Остановить экземпляр
  • Отсоединить загрузочный диск
  • Прикрепите загрузочный диск к другому экземпляру (в качестве незагружаемого диска)
  • Копирование ключей, изменение прав доступа, и т.д.
  • отделите диск
  • Заново его исходного экземпляра
  • Start оригинальный экземпляр
  • Войти!

Смотрите статьи:

Смежные вопросы