Facebook
Twitter
LinkedIn
YouTube
SysAdminMan
  • Blog
  • Contact

ssh: connect to host … port 22: Connection refused

29 May 2008MattLinux

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.


Related posts:
  1. ssh: connect to host … port 22: Connection refused – UPDATE
  2. Brute force SSH login attempts
  3. Making your SSH service secure
  4. iptables for asterisk
Previous post Where’s all my disk space gone! – linux Next post vps monitoring

3 comments. Leave new

sysadminman.net
2 June 2008 9:39 am

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…

Sakthi yuvaraj
1 April 2009 11:44 pm

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

matt
2 April 2009 8:09 am

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

Categories

A2Billing is written and maintained by Star2Billing
FreePBX® is a Registered Trademark of Schmooze Com, Inc.

© 2015 SysAdminMan Ltd
Registered in England and Wales, Company No. 7198077
The Apex, 2 Sheriffs Orchard, Coventry, England, CV1 3PP