Vic*_*dov 29 connection ssh amazon-ec2 amazon-web-services ubuntu-12.04
最近,我建立了一个新的EC2实例。第二天,我无法通过ssh连接到我的实例。我可以在前一天连接和断开连接,我发誓我什么也没做。这是ssh调试信息:
ssh -i webserver.pem -v ubuntu@my.elastic.ip
OpenSSH_5.9p1, OpenSSL 0.9.8r 8 Feb 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to my.elastic.ip [my.elastic.ip] port 22.
debug1: Connection established.
debug1: identity file webserver.pem type -1
debug1: identity file webserver.pem-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1.1
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1.1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9
debug1: SSH2_MSG_KEXINIT sent
Connection closed by my.elastic.ip
Run Code Online (Sandbox Code Playgroud)
有没有办法解决这个问题?还是应该重新安装我的实例?请帮忙,因为我需要尽快解决此问题。非常感谢您的帮助!
我的.pem的PS权限设置为600。
Tyl*_*ler 197
我的问题是用户名不正确。在ubuntu实例上,它应该是“ ubuntu”,在亚马逊实例上,它应该是“ ec2-user”。
小智 45
通常,您应该使用用于启动实例的 AMI 的默认用户名:
对于 Amazon Linux 2 或 Amazon Linux AMI,用户名为
ec2-user。
对于 CentOS AMI,用户名为 centos。
对于 Debian AMI,用户名为 admin 或 root。
对于 Fedora AMI,用户名为 ec2-user 或 fedora。
对于 RHEL AMI,用户名为 ec2-user 或 root。
对于 SUSE AMI,用户名为 ec2-user 或 root。
对于 Ubuntu AMI,用户名为 ubuntu。
否则,如果 ec2-user 和 root 不起作用,请与 AMI 提供商联系。
小智 7
检查您的安全组。确保您有一个出站规则,该规则允许流量从实例返回。
使用默认出站规则
type: All traffic, Protocol: All, Ports: All, Destination: 0.0.0.0/0
Run Code Online (Sandbox Code Playgroud)
它会工作。
归档时间: |
|
查看次数: |
22676 次 |
最近记录: |