我有一个Aws EC2实例已经运行了几个月没有任何问题。
今天,当我想使用ssh访问它时:
ssh -i" DRUID_PROD_NEW.pem" ec2-user@eX.X.X.x.compute-1.amazonaws.com
我收到了
权限被拒绝(publickey)。
昨天运作良好,但现在我无法连接。过去几个月我没有对服务器进行任何更改。
我在2月份遇到了完全相同的问题。我不得不做一个新的实例,并复制一切。如果这是一个常态,那将是一个完全失业的亚马逊。
我感谢任何帮助。
OpenSSH_6.6.1, OpenSSL 1.0.1k-fips 8 Jan 2015
debug1: Reading configuration data /home/kim/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug1: Connecting to ec2-XX-XX-XX-XX.compute-1.amazonaws.com [XX.XX.XX.XX] port 22.
debug1: Connection established.
debug1: identity file DRUID_PROD_NEW.pem type -1
debug1: identity file DRUID_PROD_NEW.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1
debug1: match: OpenSSH_6.6.1 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA XX:XX:XX:XX:2e:3c:c7:56:94:6f:97:56:68:9d:e0:06 [MD5]
debug1: Host 'ec2-XX-XX-XX-XX.compute-1.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /home/kim/.ssh/known_hosts:45
debug1: ssh_ecdsa_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: DRUID_PROD_NEW.pem
debug1: key_parse_private2: missing begin marker
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
由于 金
答案 0 :(得分:0)
我发现了什么问题。
几周前,我将ec2-user目录更改为group readable。它显然使机器无法进入。我完全忘记了这一点,今天当我需要访问机器时,我收到了臭名昭着的错误。
因此,将ec2-user主目录的权限更改回755解决了这个问题。
感谢您花时间尝试帮助我摆脱这种情况。
金