我刚刚在 AWS 上创建了一个 EC2 实例。在此之前,我创建了我的密钥对,下载了私钥。
我现在正在尝试登录到新创建的实例(使用正确的主机名,当然,为了安全起见,我在这里替换了)。我添加了 -v 开关来获取调试输出:
ssh ec2-user@myVirtualHost.compute-1.amazonaws.com -i ~/EC2key.pem -v
虽然我提供了密钥文件,但我被要求输入密码。这是调试输出的摘录,可能显示出了什么问题:
debug1: Host 'myVirtualHost.compute-1.amazonaws.com' is known and matches the ECDSA host key.
debug1: Found key in /home/myuser/.ssh/known_hosts:15
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,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/myuser/EC2key.pem
debug1: read PEM private key done: type RSA
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
ec2-user@myVirtualHost.compute-1.amazonaws.com's password:[asks for password here]
为什么在“读取 PEM 私钥完成:键入 RSA”之后得出的结论是“可以继续的身份验证:公钥,密码”?