由于负载过重而无法重启EC2实例。当它恢复时,我再也无法进入SSH。 -vvv
ssh命令生成了此输出,但我不确定如何解释此...(IP模糊处理)
OpenSSH_7.2p2, LibreSSL 2.4.1
debug1: Reading configuration data /Users/ecomevo/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 20: Applying options for *
debug2: resolving "xx.xx.xx.xx" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to xx.xx.xx.xx [xx.xx.xx.xx] port 22.
debug1: Connection established.
debug1: identity file /Users/ecomevo/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/ecomevo/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/ecomevo/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/ecomevo/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/ecomevo/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/ecomevo/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/ecomevo/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/ecomevo/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2
我检查了ssh相关文件的权限,但不确定是否是问题:
$ ls -alF .ssh/
total 56
drwx------ 11 ecomevo staff 374 Jul 15 12:02 ./
drwxr-xr-x 20 ecomevo staff 680 Nov 26 18:45 ../
-rw-r--r-- 1 ecomevo staff 6148 May 25 2015 .DS_Store
-rw------- 1 ecomevo staff 299 Jul 15 12:05 config
-rw------- 1 ecomevo staff 179 Jun 25 2015 environment
-rw------- 1 ecomevo staff 3326 May 15 2015 id_rsa
-rw------- 1 ecomevo staff 750 May 15 2015 id_rsa.pub
-rw-r--r-- 1 ecomevo staff 17747 Oct 13 12:21 known_hosts
-rw-r--r-- 1 ecomevo staff 2786 May 19 2015 known_hosts.old
重新启动我的Mac并没有解决问题,因为我已经在其他帖子中看到了建议。
答案 0 :(得分:1)
您可能无法连接通常有三个原因:
connection established
,所以情况并非如此。如果您认为一切正确,但仍然无法正常工作,那么您可以将另一个公钥复制到EC2实例中(进入用户的.ssh/authorized_keys
文件)。如果您可以通过其他用户访问服务器,那么他们可以为您复制密钥。如果您无法访问服务器,则:
答案 1 :(得分:0)
在EC2的测试服务器上,我观察到相同的问题,并收到以下错误: “ ssh_exchange_identification:读取:对等方重置连接” 这是在运行一些漏洞评估扫描后发生的。 我做的第一件事是重新启动EC2实例,但是并没有解决问题,然后我停止了服务器,然后重新启动,从而解决了问题。
谢谢
答案 2 :(得分:0)
我遇到了同样的问题。甚至我也尝试通过 EC2 instance connect
启动,但从未奏效。
重新启动我的实例后,我发现我的 cron
作业无法在我的 t2.medium
实例中分配内存。看起来有些作业占用的内存比预期的要大。
anacron[21604]: Can't fork: Cannot allocate memory