LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SSH connection refused (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-connection-refused-907089/)

fukawi1 10-08-2011 10:45 AM

1) how are you forwarding the port?

2) go to http://www.whatsmyip.org does it say your ip is 86.184.34.109

3) i dont know if one can put putty in verbose mode, but if you can, do that? does it have a more descriptive error? is putty set to use the correct port?

4) is the putty box behind a firewall that is preventing it from getting through?

5) did Juako's suggestion of "grep -Ri ssh /var/log/*" come up with any thing?

deep27ak 10-08-2011 10:54 AM

Have you checked whether sshd service is up and running properly on both the machines?

and the iptables setting of both the machines needs to be checked
You have posted the iptables output of your machine and not of the machine of your friend.

There is no issue with putty.

It is something with the sshd service

Check whether your ssh service is up and running
Code:

#ps -aux | grep sshd
Also check for port 22 whether your machine is listening or not

Code:

#netstat -nap | grep :22
Just try restarting the service

Code:

#service sshd restart

and check the connectivity to make sure both machines are in network
Code:

#ping 192.168.0.X(IP of your friends machine)

Try connecting to any other machine whether it gives the same error from both the machines.

(and all the above things needs to be checked on both machines)

frankbell 10-09-2011 09:06 PM

Is the ssh server daemon running on the target machine? Not all distros enable the server (which is what answers your ssh request) by default.

You can check whether it is like this:

Code:

~$ ps -A | grep sshd
 2602 ?        00:00:00 sshd

If the ps command returns nothing, there's nobody home to answer the door when you come knocking.

Also, make sure the ssh port (22 by default) is open in the firewall.

I spent 15 minutes on the phone with a friend today. He was getting the exact results OP is getting and not having sshd running was the reason.


All times are GMT -5. The time now is 06:58 PM.