Super User is a question and answer site for computer enthusiasts and power users. 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 have installed openssh server on my system using the following command:

apt-get install openssh-server

But when I tried to remotely access this server from another system (client) it shows me an error:

ssh: connect to host port 22: Connection refused.

Can you please help me find whether the port is open or not?

Taken from

share|improve this question

closed as unclear what you're asking by Oliver Salzburg Nov 25 '13 at 17:37

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

Have you verified that the server is actually running? Run sudo service ssh status to find out. – user235731 Jul 19 '13 at 10:29
And did you actually try any of the fine solutions offered in the other question? – user235731 Jul 19 '13 at 10:33
Good point. Maybe it was not the best idea to repost the question instead of OP (from SO). I don't have this problem. But a typical set of checks should be useful for other users of SU. So I guess the question itself and all the answers are still valid. Maybe something better would be to close this question and make a wiki question out of referred older one? – Yauhen Yakimovich Jul 19 '13 at 10:33
As the question currently stands, you say that you installed the SSH server on a a computer ("PC1", let's say), and when you try to access a remote system ("PC2"), you got the response that there was no SSH server active at PC2. I'm guessing it's just a phrasing problem, and that you are actually trying to access PC1, not PC2, but it would be good to clarify that. Also, more information on the remote system would be good: are you trying to access it across a NAT, or are both systems within the same network? Edit the question to clarify these points. – Daniel Andersson Jul 19 '13 at 11:56

This issue may be coming from firewall or may be coming from SElinux or may be service not in running state. I'm not aware from your distribution but i will told you for RPM based & debian OS : For RPM based OS

For flush firewall command

iptable -F

For disable SElinux

setenforce 0

For start the service

service sshd restart

If you are using Debian based OS then just follow these steps : for installation

sudo apt-get install openssh-server openssh-client

To restart ssh server, enter:

sudo /etc/init.d/ssh restart

share|improve this answer

What is your distribution?

It might be a firewall problem. On ubuntu check

sudo ufw status

In general use telnet client to test tcp connection

telnet 22

(Expect to see some welcome message from OpenSSH for default settings)

or network scanners like nmap on your client-side:

nmap -p 22

Finally check your /etc/ssh/sshd_config as well as if the sshd daemon is running

ps aux | grep sshd

share|improve this answer

Not the answer you're looking for? Browse other questions tagged .