1

尽管我通常对 github 或 heroku 没有任何问题,但我似乎无法使用 SSH 连接到 AWS。调试如下,我试过@ubuntu 和@ec2-user(应该是@ubuntu),我也试过在.ssh 中创建一个配置文件(在windows 上)并添加'ChallengeResponseAuthentication yes',因为那似乎在另一个线程上修复它,但没有运气。我已将 .pem 文件的权限修改为 400。我不明白为什么它说这一切听起来都是积极的但随后失败了,如果我能更好地了解错误是什么,我可能会找到解决方案. 非常感谢任何帮助!

$ ssh -v -i futurebot2.pem ubuntu@ec2-54-218-75-37.us-west-2.compute.amazonaws.com
OpenSSH_6.2p2, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/Mark/.ssh/config
debug1: Connecting to ec2-54-218-75-37.us-west-2.compute.amazonaws.com [54.218.75.37] port 22.
debug1: Connection established.
debug1: identity file futurebot2.pem type -1
debug1: identity file futurebot2.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1 pat OpenSSH_5*
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA f2:cd:94:4d:a1:9a:b5:67:cb:f7:91:d7:ef:4d:a4:3d
debug1: Host 'ec2-54-218-75-37.us-west-2.compute.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /home/Mark/.ssh/known_hosts:1
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
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: futurebot2.pem
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).
4

1 回答 1

2

这可能发生的两个原因。

  1. 用户不存在,这可能是由于连接了错误的用户或不是您自己的实例(错误的 IP 地址)

  2. 用户的授权密钥文件中没有您的密钥。在 AWS 中,您在启动时选择的密钥会添加到您的实例中,但如果您想使用其他密钥,则需要authorized_keys手动将它们添加到您的文件中。

于 2013-06-24T23:55:17.140 回答