Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am able to ping my friend but not able to do ssh. Why so? He is using a modem. I thought there might be some firewall enabled. I told him to type

#iptables -F

He did that, but still I am not able to do ssh on his system. How can I do this?

I get the error: ssh: connect to host 182.64.31.131 port 22: Connection refused

RESULT OF ifconfig on his system

 inet addr:127.0.0.1  Mask:255.0.0.0
inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0

He told me his dynamic ip by using whatismyip.com

I tried ssh on that ip.

PS: sshd service is running on his system.
I tried nmap and came to know that port 22 is not opened.

share|improve this question
4  
Does he have an SSH daemon (sshd) running? Also, is he behind a router? If he is, you'll need port forwarding enabled on the router. –  sbtkd85 Sep 13 '11 at 17:24
    
Are you sure that sshd is running on that machine? It is listening on all interfaces/addresses (ListenAddress)? Are there any entries in /etc/hosts.deny? There is a local address at the interface, so is port 22 forwarded to that machine? –  pbm Sep 13 '11 at 17:29
    
We both have different ISP. –  Chankey Pathak Sep 13 '11 at 17:29
    
yes sshd is running. –  Chankey Pathak Sep 13 '11 at 17:32
add comment

1 Answer 1

up vote 6 down vote accepted

As @sbtkd85 notes, it's almost certainly because port forwarding needs to be set up at his router/access point.

Here's some related/maybe pertinent info: http://forum.portforward.com/YaBB.cgi?num=1139203841

Cheers, Robert

share|improve this answer
2  
The hint that NAT is happening between his friend and The Internet is this: inet addr:192.168.1.2 The 192.168.x.x address is a "non-routable" IP address reserved for use inside intranets. –  Bruce Ediger Sep 13 '11 at 19:30
add comment

Your Answer

 
discard

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.