只需build立一个新的EC2实例,下载了pem文件,目前无法进入框。 我正在使用命令…
$ ssh -i .ssh/key.pem ubuntu@ec2-176-34-183-***.eu-west-1.compute.amazonaws.com
被要求input密码 当我生成密钥对时,我没有分配密码短语! 为什么会这样呢?
Anway,我有一个挖掘,发现如何从密钥中删除密码短语:
$ openssl rsa -in key.pem -out key-nopass.pem
尽pipe密语确实已被删除,但仍然没有喜乐。 这是我的详细输出:
OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 Mar 2009 debug1: Reading configuration data /home/bob/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to ec2-176-34-183-***.eu-west-1.compute.amazonaws.com [176.34.183.***] port 22. debug1: Connection established. debug1: identity file key-nopass.pem type -1 debug1: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian- 3ubuntu7 debug1: match: OpenSSH_5.3p1 Debian-3ubuntu7 pat OpenSSH* debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu7 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 'ec2-176-34-183-***.eu-west-1.compute.amazonaws.com' is known and matches the RSA host key. debug1: Found key in /home/bob/.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-nopass.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).
BTW pem文件权限设置为600.为什么我不能login?
这里可能会有一些事情发生。 首先,它看起来像你正在尝试login到Ubuntu的用户。 您确定该用户存在,并且该密钥对与该用户相关联吗? 我会尝试以root身份login,看看是否有效。
另一种可能性是你的私钥是错误的。 您是直接下载还是使用复制/粘贴创build密钥? 如果是后者,则可能没有正确粘贴。
权限是正确的,所以它必须是以上之一。 私钥可能不在您正在尝试login的authorized_keys中,或者您拥有错误/损坏的密钥。