Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let me briefly tell what I did. I have a HOST_NAME running on CentOS 5.6. Today I've connected to it via SSH and run yum update, after some time, my SSH connection frozen. Then I've tried to reconnect to it and all what I get is: ssh: connect to host SOME_HOST port 22: Connection refused Server is running, only problem that we can't access it. Please help me what I can do?

share|improve this question
up vote 0 down vote accepted

First of all, check if port 22 is open. You can do it with nmap HOST_NAME from your workstation. However,

Connection refused

tells you it is closed.

If port is closed and you have no physical access to the server, there isn't much you can do. Ask someone who has access to check if sshd is running and to check the firewall.

share|improve this answer
OK Thanks for your reply. As you said I've executed nmapon it, it has shown me that it is closed. Then I've runned through PHP ps ax and didn't find sshd. Now I need to go to data-center resolve this issue. What should I do when I will have phys.access to server? Thanks – Askhat Mar 13 '13 at 6:33
If you have PHP-shell, you can check everything remotely. Anyway, commands gonna be the same on the phys. console. Firstly, make sure sshd is installed: yum list installed openssh-server. If so, make sure it is running: service sshd status, if it's not running - sudo service sshd start. Also make chkconfig sshd on to have SSH daemon running across reboots. If it is running and listening port 22 (netstat -atnl), it maybe the firewall who doesn't let packets reach port 22. Then check iptables rules. – Gevial Mar 13 '13 at 6:53
Man you just saved my life. I did everything that you said, the problem was that yum update command got frozen and sshd turned off. I've just killed yum update process and started sshd service again. Thanks for your reply – Askhat Mar 13 '13 at 9:19
Nice to hear it! Welcome! – Gevial Mar 13 '13 at 9:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.