简体   繁体   English

在Amazon AWS上克隆EC2实例后无法ssh in

[英]can't ssh in after cloning an EC2 instance on Amazon AWS

I have a working m3.large instance on Amazon AWS that I'm able to login to using a username and a password via ssh. 我在Amazon AWS上有一个正常工作的m3.large实例,可以通过ssh使用用户名和密码登录。 I've cloned it by creating an AMI of it and then spinning up another m3.large instance based on that AMI, but I cannot ssh into it. 我已经通过创建它的AMI克隆了它,然后基于该AMI旋转了另一个m3.large实例,但是我无法将其SSH入其中。 In putty, after typing in my username, I get "Server refused our key" followed by Disconnected: No supported authentication methods available (server sent: publickey). 在腻子中,输入用户名后,出现“服务器拒绝我们的密钥”,然后显示“断开连接:无可用的身份验证方法(服务器发送:publickey)”。 Shouldn't the new cloned instance behave exactly like the one the AMI came from? 新克隆的实例的行为不应该与AMI来自的实例完全一样吗? Shouldn't the only difference be their IP addresses? 唯一的区别不是他们的IP地址吗?

Ok i figured out that the problem was in the original instance, the one I'd cloned. 好的,我发现问题出在最初的实例中,即我克隆的那个实例。 In its /etc/ssh/sshd_config, i'd neglected to include the line PasswordAuthentication yes For some reason even with it set to no I could login on the original instance, but not on the clone. 在它的/ etc / ssh / sshd_config中,我忽略了包含行PasswordAuthentication yes。出于某种原因,即使将它设置为no,我也可以登录原始实例,但不能登录克隆。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM