在远程服务器的 sshd_config 中添加了 Listen 443。为什么我不能 ssh -p 443 / 22?
Added Listen 443 in remote server's sshd_config. Why I can't ssh -p 443 / 22?
在一时的虚弱中,我羞怯地遵循了 tutorial 关于如何绕过 public 库的 Wifi ssh 限制连接到我的 Amazon EC2 远程服务器的方法。
所以我做的第一件事就是将以下(最后)行添加到驻留在远程 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
...我明白了:
$ 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 连接到默认端口 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
我还在我的 Amazon EC2 中添加了以下行 'Security Groups'...
Custom TCP port 443
...无济于事。
我是否有效地将自己锁定在远程服务器之外?我正在学习有关如何建立隧道的教程,然后发生了这种情况。不应该刚刚添加到 /etc/ssh/sshd_config...
Port 443
...而不是 'ListenAddress 443' ?
我以前从未遇到过通过 ssh 连接到我的远程服务器(这是一个 Debian Wheezy)的问题。
据我所知,我仍然可以分离我的卷,将它重新连接到一个新实例,修复 sshd_config 文件等。我希望有替代方法。
所以我的问题是:考虑到 ssh_config 中的行 'ListenAddress 443' 是否可以连接到我的远程服务器?如果是这样,如何?也许更重要的是,如果除了 ListenAddress 443 之外我没有触及或更改任何 n sshd_config,为什么我无法连接到端口 22?
提前致谢!
编辑:
telnet xx.xx.xxx.xx 22
Trying xx.xx.xxx.xx...
telnet: Unable to connect to remote host: Connection refused
由于以下三个原因之一,您无法连接:
远程服务器上的 sshd
已关闭,因为它无法解析 ListenAddress 443
.
sshd
将 ListenAddress 443
解析为 IP 地址('443' 可以解释为 IP 地址 - IPv4 地址在低级别由 32 位表示无符号整数)但无法绑定到“443”表示的 IP 地址并且已关闭。
sshd
将 ListenAddress 443
解析为 IP 地址,成功绑定到该 IP 地址,现在 运行 并在“0.0.0.0”上侦听传入连接。 1.187" 或将“443”解释为 IP 地址的类似解释。
在一时的虚弱中,我羞怯地遵循了 tutorial 关于如何绕过 public 库的 Wifi ssh 限制连接到我的 Amazon EC2 远程服务器的方法。
所以我做的第一件事就是将以下(最后)行添加到驻留在远程 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
...我明白了:
$ 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 连接到默认端口 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
我还在我的 Amazon EC2 中添加了以下行 'Security Groups'...
Custom TCP port 443
...无济于事。
我是否有效地将自己锁定在远程服务器之外?我正在学习有关如何建立隧道的教程,然后发生了这种情况。不应该刚刚添加到 /etc/ssh/sshd_config...
Port 443
...而不是 'ListenAddress 443' ?
我以前从未遇到过通过 ssh 连接到我的远程服务器(这是一个 Debian Wheezy)的问题。
据我所知,我仍然可以分离我的卷,将它重新连接到一个新实例,修复 sshd_config 文件等。我希望有替代方法。
所以我的问题是:考虑到 ssh_config 中的行 'ListenAddress 443' 是否可以连接到我的远程服务器?如果是这样,如何?也许更重要的是,如果除了 ListenAddress 443 之外我没有触及或更改任何 n sshd_config,为什么我无法连接到端口 22?
提前致谢!
编辑:
telnet xx.xx.xxx.xx 22
Trying xx.xx.xxx.xx...
telnet: Unable to connect to remote host: Connection refused
由于以下三个原因之一,您无法连接:
-
远程服务器上的
sshd
已关闭,因为它无法解析ListenAddress 443
.sshd
将ListenAddress 443
解析为 IP 地址('443' 可以解释为 IP 地址 - IPv4 地址在低级别由 32 位表示无符号整数)但无法绑定到“443”表示的 IP 地址并且已关闭。sshd
将ListenAddress 443
解析为 IP 地址,成功绑定到该 IP 地址,现在 运行 并在“0.0.0.0”上侦听传入连接。 1.187" 或将“443”解释为 IP 地址的类似解释。