我已经使用带有LAMP的EC2服务器几个月了,突然间我无法通过ssh连接到它。我在Cygwin上运行相同的命令我已经开始运行,因为我已经开始使用它,这是:
ssh -i ./Desktop/keys/teste.pem ubuntu@54.94.211.146 -v
起初我在调试器上收到了这条消息:
$ ssh -i Desktop/teste.pem -v ubuntu@54.94.211.146
OpenSSH_6.7p1, OpenSSL 1.0.1j 15 Oct 2014
debug1: Connecting to 54.94.211.146 [54.94.211.146] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file Desktop/teste.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file Desktop/teste.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7
ssh_exchange_identification: Connection closed by remote host
然后我尝试通过AWS仪表板重新获取EC2实例。现在我明白了:
$ ssh -i ./Desktop/keys/teste.pem ubuntu@54.94.211.146 -v
OpenSSH_6.7p1, OpenSSL 1.0.1j 15 Oct 2014
debug1: Connecting to 54.94.211.146 [54.94.211.146] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file ./Desktop/keys/teste.pem type -1
debug1: key_load_public: No such file or directory
debug1: identity file ./Desktop/keys/teste.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 54.94.211.146
我完全不知道发生了什么。我既不记得做任何异常也不记得身份文件,因为调试器表明问题在于识别。我已经尝试使用其他计算机和“teste.pem”的备份进行ssh,错误是相同的。我真的很茫然。
提前致谢!
编辑:在@asimovwasright的请求中,我运行了没有id文件的命令并得到了这个:
$ ssh -v ubuntu@54.94.211.146
OpenSSH_6.7p1, OpenSSL 1.0.1j 15 Oct 2014
debug1: Connecting to 54.94.211.146 [54.94.211.146] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /cygdrive/c/Users/Gabriel/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cygdrive/c/Users/Gabriel/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cygdrive/c/Users/Gabriel/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cygdrive/c/Users/Gabriel/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cygdrive/c/Users/Gabriel/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cygdrive/c/Users/Gabriel/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cygdrive/c/Users/Gabriel/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /cygdrive/c/Users/Gabriel/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
Connection closed by 54.94.211.146
基本上和以前一样的错误,所以我认为身份文件不应该受到责备。