I run a backup script to backup my VPS’s every night using rsync. On one of my VPS’s I was seeing the error “ssh: connect to host … port 22: Connection refused” at seeming random points.
It took me a while to track down the fact that lylix.com (the provider of my VPS) block multiple inbound and outbound ssh connections to a server made over a short period of time.
Whilst this is probably useful for some people, and will offer their VPS some protection from brute force login attempts, it broke my script! 🙂
One easy solution is to change the SSH port on my backup server to something other than 22 as lylix are only monitoring port 22.
I guess it’s more than possible that other providers are also doing this.
3 comments. Leave new
ssh: connect to host … port 22: Connection refused – UPDATE…
As someone pointed out here another possibilty for these kind off error messages is that, if you’ve just changed the SSH port from 22 to something else for security, then there’s a good chance your firewall may be blocking the connection.
R…
When i give the ssh command to connect remote system in a lan the following error is coming..
ssh: connect to host 192.168.20.162 port 22: Connection refused
Hi Sakthi, that could be lots of things I’m afraid as it probably just means there was no response from the server. Some distros don’t start the SSH daemon adter being installed to make sure that sshd is running if you can