【问题标题】:AWS public key denied issueAWS 公钥被拒绝问题
【发布时间】:2011-10-29 00:58:38
【问题描述】:

我读了这篇文章:

AWS ssh access 'Permission denied (publickey)' issue

那里的信息是相关的,但不能帮助我解决我的问题。我曾经能够使用 ec2-user 使用以下命令登录到我在 AWS 上的 linux 实例:

ssh -i key.pem ec2-user@[address].compute-1.amazonaws.com 从我的 MacBook 终端

在过去的几周里,我现在收到了这个错误:

“权限被拒绝(公钥)。”

我试过了

ssh -v -i key.pem ec2-user@[address].compute-1.amazonaws.com 从我的 MacBook 终端

我得到这个输出:

OpenSSH_5.2p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to [address].compute-1.amazonaws.com [address] port 22.
debug1: Connection established.
debug1: identity file key.pem type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.2
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: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host '[address].compute-1.amazonaws.com' is known and matches the RSA host key.
debug1: Found key in [path]/.ssh/known_hosts:1
debug1: ssh_rsa_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: key.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).

对发生的事情有什么建议吗?如何解决这个问题?

我在之前创建的此实例上有另一个用户帐户。我可以使用它登录,然后 sudo 进入根目录。我只是无法再使用 ec2-user 登录。

谢谢!

【问题讨论】:

  • 您是否尝试过致电亚马逊支持?
  • 在过去的几周里,您是否执行过任何操作 - 在 AWS 中生成新密钥或在您的机器中删除 SSH 密钥等。
  • 显然您的 SSH 密钥有问题。你试过root用户吗?

标签: amazon-web-services public-key


【解决方案1】:

您可能需要以 root 身份登录。如果使用 bitnami 图像,请以 'bitnami' 身份登录

例如ssh -v -i key.pem bitnami@[address].compute-1.amazonaws.com

【讨论】:

    猜你喜欢
    • 2021-01-21
    • 2018-11-15
    • 1970-01-01
    • 2011-07-15
    • 1970-01-01
    • 2010-11-30
    • 2017-03-24
    • 2016-08-31
    • 2016-09-19
    相关资源
    最近更新 更多