即使使用新的 EC2 实例,AWS SSH 登录仍然失败

即使使用新的 EC2 实例,AWS SSH 登录仍然失败

我刚刚开始使用 AWS 在 EC2 实例上创建一个 wordpress 网站(使用https://www.youtube.com/watch?v=4WR7EFFLF04)。一切都运行正常,直到我尝试使用另一个教程添加 SSL 证书(我现在似乎找不到)。

在执行这些步骤时,由于重定向次数过多,网站出现问题(假设是 DNS 错误),无法加载。当我返回教程尝试修复我所做的事情时,我发现它让我通过 SSH 登录,而我之前这样做没有任何问题,然后我开始收到“权限被拒绝(公钥)”错误。

从那时起,我就无法登录该实例或任何其他实例,否则会收到相同的错误。我甚至尝试使用全新的密钥创建新实例,但仍然会收到相同的错误。

当我运行启用了详细模式的命令时,它会给出以下输出:

debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 47: Applying options for *
debug1: Connecting to ec2-13-59-207-225.us-east-2.compute.amazonaws.com port 22.
debug1: Connection established.
debug1: identity file /Users/bradley/Desktop/John and Rhonda Wordpress Files/keypair-2.pem type -1
debug1: identity file /Users/bradley/Desktop/John and Rhonda Wordpress Files/keypair-2.pem-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.9p1 Debian-10+deb10u2
debug1: match: OpenSSH_7.9p1 Debian-10+deb10u2 pat OpenSSH* compat 0x04000000
debug1: Authenticating to ec2-13-59-207-225.us-east-2.compute.amazonaws.com:22 as 'admin'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:OiIQ5QiVxQvN9lAkjLm90ynddjDDs9L75PqDAL/cTv4
debug1: Host 'ec2-13-59-207-225.us-east-2.compute.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /Users/bradley/.ssh/known_hosts:6
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/bradley/Desktop/John and Rhonda Wordpress Files/keypair-2.pem  explicit
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /Users/bradley/Desktop/John and Rhonda Wordpress Files/keypair-2.pem
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
[email protected]: Permission denied (publicly).

知道发生什么事了吗?

我最初在 stack overflow 上提出了这个问题,但由于偏离主题而被关闭,所以如果这里不是提出这个问题的正确地方,请告诉我在哪里 :)

相关内容