ssh: connect to host … port 22: Connection refused

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 thoughts on “ssh: connect to host … port 22: Connection refused

  1. Pingback: sysadminman.net

  2. Sakthi yuvaraj

    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

  3. matt Post author

    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

Comments are closed.