I have two virtual servers with Ubuntu 16.04 hosted by different providers. After I migrated my desktop from Win7 to Win10 I can not connect to the servers via SSH (see the error messages below). I have tried other operating systems as well:
The same application (JuiceSSH) can connect on Android, but returns 'connection refused' on ChromeOS.
The error messages:
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.
Remarks:
Solution:
The port 22 was for some computers blocked on the router. It had nothing to do with the operating system. After opening the port for all computers, works everyting perfect. Thanks to @Nathan-McCoy
Just making my original comment more visible.
Not all systems allow TCP
port 22
by default, which is the default port for ssh
.
Here are some things to try and help find the source of the issue.
Run nmap <server>
on the client which wants to connect via ssh.
If port 22
is not shown as open, this may be a firewall issue.
Run netstat
on the server to see which ports are open.
If port 22
is not LISTENING
then the ssh daemon is not setup properly.