Configuring SSH on Ubuntu to connect to remote computer
Hi there.
I'm having problems when I try to connect remotely to other computer using open ssh server, using this command: ssh example@11.111.11 it returns "connection timed out" after a while. So, I went through all sorts of websites and tutorials to see what's going on. I tried enabling the standard port 22 on my firewall and tried to create a static IP adress so I can use port 22 properly. But it looks it doesn't worked. I don't know if this makes any difference, but my Ubuntu is connected via wireless to a router (D-Link DI-524) and I tried to change some configurations on it too. But still it doesnt work at all. Any clue please? I'm using ubuntu 11.10. Cheers |
You mean from the outside to your machine at home behind the router? It needs a) a fixed TCP/IP address and not a random one from the DHCP server in the router, b) it’s necessary to define a forwarding in the router, that incoming packets for port 22 are routed to this particular machine all the time.
|
I've already done this, and still it doesn't work.
|
The sshd is running on the Ubuntu machine, i.e.: you can log in via ssh on the machine itself by connecting to localhost?
|
I think you need to explain your situation a bit more clearly. You only mention one computer in your post, yet ssh requires two computers (a client and a server). Which one is your ubuntu machine? Where is the other one? Are you trying to connect from within the LAN or from the outside world? Which one have you been adjusting the settings on? We need a much clearer picture of what you're trying to do here before we can offer any substantial advice.
|
Quote:
|
Quote:
|
please post the output of:
Code:
ping -c 5 www.02144.com |
Quote:
64 bytes from 64.235.229.141: icmp_req=1 ttl=50 time=511 ms 64 bytes from 64.235.229.141: icmp_req=2 ttl=50 time=629 ms ^C64 bytes from 64.235.229.141: icmp_req=3 ttl=50 time=317 ms --- 02144.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 12687ms rtt min/avg/max/mdev = 317.364/486.385/629.813/128.834 ms PING xxx.xx.xxx.xxx (xxx.xx.xxx.xxx) 56(84) bytes of data. 64 bytes from xxx.xx.xxx.xxx: icmp_req=1 ttl=54 time=137 ms 64 bytes from xxx.xx.xxx.xxx: icmp_req=2 ttl=54 time=20.9 ms 64 bytes from xxx.xx.xxx.xxx: icmp_req=3 ttl=54 time=21.9 ms 64 bytes from xxx.xx.xxx.xxx: icmp_req=4 ttl=54 time=21.3 ms 64 bytes from xxx.xx.xxx.xxx: icmp_req=5 ttl=54 time=22.6 ms --- xxx.xx.xxx.xxx ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4005ms rtt min/avg/max/mdev = 20.984/44.799/137.127/46.167 ms OpenSSH_5.8p1 Debian-7ubuntu1, OpenSSL 1.0.0e 6 Sep 2011 debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug2: ssh_connect: needpriv 0 debug1: Connecting to xxx.xx.xxx.xxx [xxx.xx.xxx.xxx] port 22. debug1: connect to address xxx.xx.xxx.xxx port 22: Connection timed out ssh: connect to host xxx.xx.xxx.xxx port 22: Connection timed out |
sorry, i dont have an answer but this mite help diagnose:
Code:
nmap -p 22 11.111.11 |
Quote:
Note: Host seems down. If it is really up, but blocking our ping probes, try -PN Nmap done: 1 IP address (0 hosts up) scanned in 3.44 seconds I checked the two files either and the two seem ok. Also I tried disabling the firewall and it also doesnt worked. |
as far as your nmap thinks the remote host doesnt have an ssh server running on port 22. you can retry the command like this:
Code:
nmap -PN -p 22 11.111.11 are you able to try on another pc at another location ? edit: also, just for the shiggles, what does this yeild you: Code:
nmap -p 22 www.02144.com |
Quote:
Starting Nmap 5.21 ( http://nmap.org ) at 2012-10-29 16:48 BRST Nmap scan report for www.02144.com (64.235.229.141) Host is up (0.57s latency). PORT STATE SERVICE 22/tcp open ssh |
^ so the nmap above states that 02144.com's ssh server is on and open to accepting connections from your pc. it seems like the other server you are trying to connect to is on but its ssh server is off.
maybe they only allow connections from inside their building ? my workplace is like that; if i want to work-from-home i would need to connect via vpn which makes it appear as if i am connecting from inside the building. |
Having sshd installed and running, what is going on is one of these (or both):
1) You have a firewall installed on server blocking incoming connections to port 22 (or not explicitly ACCEPTing them) 2) Your router is not routing/NATing incoming connections to port 22 to your internal server. You can almost debug 1) by trying to connect to the server from a PC into the same local network. You can debug 2) by checking server's IP and router's NATing table and, if exists, router's firewall rules. Of course, you shouldn't use DCHP on the server. Use fixed/static IP. |
All times are GMT -5. The time now is 10:01 AM. |