我刚在 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类型”之后,结论是“可以继续进行的认证方式:公钥、口令”?