在脆弱的时刻,我不好意思地遵循了一个教程,介绍了如何绕过公共库的Wifi限制连接到我的Amazon远程服务器。
因此,我做的第一件事是将以下(最后)行添加到驻留在远程EC2 AMazon服务器中的/etc/ssh/sshd_config文件中:
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
ListenAddress 443然后,我重新启动ssh服务器,然后突然从远程服务器注销。所以当我在本地的机器上做这个的时候.
$ ssh -i /path/to/key.pem xxx@xx.xx.xxx.xx -p 443 -v...I得到了以下信息:
$ ssh -i /path/to/key.pem xxx@xx.xx.xxx.xx -v -p 443
OpenSSH_6.0p1 Debian-4+deb7u2, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to xx.xx.xxx.xx [xx.xx.xxx.xx] port 443.
debug1: connect to address xx.xx.xxx.xx port 443: Connection timed out
ssh: connect to host xx.xx.xxx.xx port 443: Connection timed out如果我尝试ssh到default的端口22,就会得到以下结果:
OpenSSH_6.0p1 Debian-4+deb7u2, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to xx.xx.xxx.xx [xx.xx.xxx.xx] port 22.
debug1: connect to address xx.xx.xxx.xx port 22: Connection refused
ssh: connect to host xx.xx.xxx.xx port 22: Connection refused我还在亚马逊的EC2 'Security‘中添加了以下一行.
Custom TCP port 443 ..。都没有用。
我真的把我锁在远程服务器之外了吗?我正在学习一个关于如何隧道的教程,然后发生了这种情况。不应该只是添加到/etc/ssh/sshd_config.
Port 443 ...instead of 'ListenAddress 443‘?
我从来没有遇到问题,我的远程服务器(这是一个Debian )。
据我所知,我仍然可以分离我的卷,将它重新附加到一个新的实例中,修复sshd_config文件等等。
因此,我的问题是:考虑到ssh_config中的“ssh_config 443”行,可以连接到远程服务器吗?如果是这样的话,是怎么做的?也许更重要的是,如果除了sshd_config 443之外,我没有触摸或更改ListenAddress 443之外的任何东西,那么为什么不能在端口22上连接呢?
提前感谢!
编辑:
telnet xx.xx.xxx.xx 22
Trying xx.xx.xxx.xx...
telnet: Unable to connect to remote host: Connection refused发布于 2015-04-24 14:21:38
由于以下三个原因之一,您无法连接:
sshd被关闭,因为它不能解析ListenAddress 443。sshd将ListenAddress 443解析为IP地址('443‘可以解释为IP地址-- IPv4地址由32位无符号整数在低级别表示),但无法绑定到由'443’表示的IP地址,并且处于关闭状态。sshd将ListenAddress 443解析为IP地址,成功地绑定到该IP地址,现在正在运行并侦听"0.0.1.187“上的传入连接,或者将'443‘解释为IP地址。https://stackoverflow.com/questions/29848166
复制相似问题