Amazon ec2 使用hotspot wifi时,我可以';t ssh到我的ec2中

Amazon ec2 使用hotspot wifi时,我可以';t ssh到我的ec2中,amazon-ec2,ssh,hotspot,Amazon Ec2,Ssh,Hotspot,我从来没有遇到过这样的问题,直到我开始使用热点wifi而不是我的普通wifi 在尝试ssh到我的amazon实例时,我总是得到“连接被xx.xxx.xxx.xx关闭”: jeff@jeff-Inspiron-5749:~$ ssh -v -i /path/to/key.pem ubuntu@9.99.999.99 OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014 debug1: Reading configuration data /home/jeff/.ssh/

我从来没有遇到过这样的问题,直到我开始使用热点wifi而不是我的普通wifi

在尝试ssh到我的amazon实例时,我总是得到“连接被xx.xxx.xxx.xx关闭”:

jeff@jeff-Inspiron-5749:~$ ssh -v -i /path/to/key.pem ubuntu@9.99.999.99
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/jeff/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 9.99.999.99 [9.99.999.99] port 22.
debug1: Connection established.
debug1: identity file /path/to/key.pem type -1
debug1: identity file /path/to/key.pem-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.13
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.13 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection closed by 9.99.999.99
我还尝试更改ec2的入站安全规则以接受所有ip地址:0.0.0.0/0,这有时会起作用,但只是偶尔起作用

我目前在亚马逊上选择“使用我的ip”,将我的热点ip地址列为白名单。我怀疑我的hotspot wifi可能存在连接/速度问题?但我可以在youtube上播放视频,很好

我切换回了正常的wifi,这样我就可以登录到我的ec2并查看/var/log/auth.log文件,我发现:

AUG 20 08:05:01: session opened for user root by (uid=0)
AUG 20 08:05:01: session closed for user root 

在许多行中。。。总是在同一时间。一个开放和即时的关闭。

我想我可能已经找到了罪魁祸首:插入我的手机/平板电脑,提供热点wifi!!!我认为栓系也可以解决这个问题


我注意到,在至少连接一次之后,从那时起,我可以在不插入hotspot wifi的情况下进行连接。

您是否已打开EC2实例以接收所有传入流量?我猜你在这里列出了你的正常WiFi IP地址,但没有在热点列出。是的。。。肯定是这样的。但还是没有运气