Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 192.168.1.38 port 22: Connection refused.

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

Taken from http://stackoverflow.com/questions/17743559/ssh-connect-to-host-192-168-1-38-port-22-connection-refused

share

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.

    
1  
Have you verified that the server is actually running? Run sudo service ssh status to find out. –  Brandon Invergo Jul 19 '13 at 10:29
    
And did you actually try any of the fine solutions offered in the other question? –  Brandon Invergo 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

2 Answers 2

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

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 192.168.1.38 22

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

or network scanners like nmap on your client-side:

nmap 192.168.1.38 -p 22

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

ps aux | grep sshd

share

This site is currently not accepting new answers.

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