-1

I am attempting to SSH into my host. I'm using Mac OSX. When in terminal I type:

ssh user@hostname

I get an immediate error message stating:

connect to host xx.xx.xxx.xx port 22: connection refused

I've tried SSHing into my EC2 instance(different host altogether) and I can do that just fine. Any idea what the problem might be or what further troubleshooting I can do to find out the problem and fix it?

mveroone
  • 474
  • 7
  • 22
stephenthedev
  • 113
  • 1
  • 5
  • you'll need to provide more information. try verbose logging. have you ever been able to connect. what's the history of this host? have you checked firewalls? is ssh running (check out of band)? – Drew Khoury Sep 03 '13 at 06:22

2 Answers2

3

This indicates that the ssh daemon is not running or that there is a firewall set to reject the connection.

Richard Salts
  • 755
  • 3
  • 17
0

On the system you are trying too sh to, run the following:

ps aux | grep ssh
netstat -tulpn | grep 22

You dont specify what operating system the target host is. If its Mac you may have to modify the netstat command line parameters. But simply, you need to list listening ports, and grep for port 22 which is what ssh runs on.

If you get no output from either of the above, especially the second command, then you sshd daemon is not running, and you will need to start it before you can connect.

That said, an immediate error would suggest ( as Richard mentioned ) that a firewall is blocking the connection.

GeoSword
  • 1,657
  • 12
  • 16