我有两个由不同提供商托管的Ubuntu16.04虚拟服务器。在我将桌面从Win7迁移到Win10之后,我无法通过SSH连接到服务器(请参阅下面的错误消息)。我也尝试过其他操作系统:
同样的应用程序(JuiceSSH)可以在安卓上连接,但在ChromeOS上返回“拒绝连接”。
错误信息:
1. Gitbash (Windows 10)
$ ssh user@myhost
ssh: connect to host myhost port 22: Connection refused
2. Secure Shell (ChromeOS, with -vvv)
Connection with user@myhost is established...
Loading NaCl plug-in... Finished
OpenSSH_7.6p1, OpenSSL 1.0.2k 26 Jan 2017
debug2: resolving "myhost" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to myhost [myip] port 22.
debug1: connect to address myip port 22: Connection refused
ssh: connect to host myhost port 22: Connection refused
NaCl plug-in ended with the status code"255".
3. Bitwise SSH Client (Windows 10)
...
06:34:46.871 Connecting to SSH2 server slejska.de:22.
06:34:47.918 Connection failed. FlowSocketConnector: Failed to connect to target address. Windows error 10061: No connection could be established because the target computer refused the connection.
06:34:47.949 The SSH2 session has been terminated.备注:
解决方案:
对于路由器上被封锁的一些计算机来说,端口22。这与操作系统无关。打开所有电脑的端口后,一切都工作得很完美。感谢@
发布于 2018-03-18 13:39:06
只是让我原来的评论更显眼。
并非所有系统默认都允许TCP端口22,这是ssh的默认端口。
这里有一些东西可以帮助我们找到问题的根源。
建议
检查客户端上的开放端口
在希望通过ssh连接的客户端上运行nmap <server>。
如果端口22未显示为打开,这可能是防火墙问题。
检查服务器上的开放端口
在服务器上运行netstat以查看哪些端口是打开的。
如果端口22不是LISTENING,那么ssh守护进程的设置就不正确。
https://stackoverflow.com/questions/49346779
复制相似问题