即使使用新的 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).

知道會發生什麼事嗎?

我最初在堆疊溢出上有這個問題,因為偏離主題而被關閉,所以如果這不是這個問題的正確位置,請讓我知道在哪裡:)

相關內容