Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

I changed the ssh port from 22 to 2021 and it worked correctly till 3hours ago,after that when I can't connect to ssh.

ssh: connect to host port 2021: Connection refused

so I checked iptables,I stop it from webmin,and

Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT) target prot opt source destination

Chain OUTPUT (policy ACCEPT) target prot opt source destination

where is the problem?

share|improve this question
Is the SSH service still listening on that port? – Shane Madden May 25 '12 at 15:37

The sshd process may not be running at all.

try checking with:

netstat -tulpn  | grep LISTEN | grep sshd

to see if it's running, and on which port.

share|improve this answer
definitely what one would expect if there was nothing listening there... $ ssh -p 12345 localhost ssh: connect to host localhost port 12345: Connection refused – Tom H May 25 '12 at 15:41

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.