LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 10-27-2012, 08:12 PM   #1
guitarman
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Rep: Reputation: Disabled
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
 
Old 10-28-2012, 09:02 AM   #2
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,319

Rep: Reputation: 252Reputation: 252Reputation: 252
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.
 
Old 10-28-2012, 11:33 AM   #3
guitarman
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
I've already done this, and still it doesn't work.
 
Old 10-28-2012, 11:54 AM   #4
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 11.4
Posts: 1,319

Rep: Reputation: 252Reputation: 252Reputation: 252
The sshd is running on the Ubuntu machine, i.e.: you can log in via ssh on the machine itself by connecting to localhost?
 
Old 10-28-2012, 12:37 PM   #5
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 2,603

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
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.

Last edited by suicidaleggroll; 10-28-2012 at 12:39 PM.
 
Old 10-28-2012, 09:34 PM   #6
guitarman
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Reuti View Post
The sshd is running on the Ubuntu machine, i.e.: you can log in via ssh on the machine itself by connecting to localhost?
Yes, I can. This works fine.
 
Old 10-28-2012, 09:36 PM   #7
guitarman
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by suicidaleggroll View Post
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.
The situation is this: I am the client, trying to conect to the server, which is already set up with ssh and with others clients works well. It runs ubuntu 10. I am trying to connect toe the outside world, outside my LAN. I am adjusting the settings on my computer, which I try to connect to the server.
 
Old 10-28-2012, 09:40 PM   #8
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-19-live-usb/ aix
Posts: 3,822

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
please post the output of:
Code:
ping -c 5 www.02144.com
ping -c 5 11.111.11
ssh -v -v -v  example@11.111.11
replace whatever is in red with the actual user name or server address you are trying to connect to.

Last edited by schneidz; 10-28-2012 at 09:43 PM.
 
Old 10-28-2012, 10:24 PM   #9
guitarman
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by schneidz View Post
please post the output of:
Code:
ping -c 5 www.02144.com
ping -c 5 11.111.11
ssh -v -v -v  example@11.111.11
replace whatever is in red with the actual user name or server address you are trying to connect to.
PING 02144.com (64.235.229.141) 56(84) bytes of data.
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
 
Old 10-29-2012, 10:25 AM   #10
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-19-live-usb/ aix
Posts: 3,822

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
sorry, i dont have an answer but this mite help diagnose:
Code:
nmap -p 22 11.111.11
seems like a firewall issue... check /etc/hosts.allow / /etc/hosts.deny

Last edited by schneidz; 10-29-2012 at 10:56 AM.
 
Old 10-29-2012, 01:17 PM   #11
guitarman
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by schneidz View Post
sorry, i dont have an answer but this mite help diagnose:
Code:
nmap -p 22 11.111.11
seems like a firewall issue... check /etc/hosts.allow / /etc/hosts.deny
Starting Nmap 5.21 ( http://nmap.org ) at 2012-10-29 16:11 BRST
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.
 
Old 10-29-2012, 01:24 PM   #12
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-19-live-usb/ aix
Posts: 3,822

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
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
but it will probably tell you that that port is filtered.

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

Last edited by schneidz; 10-29-2012 at 01:26 PM.
 
Old 10-29-2012, 01:50 PM   #13
guitarman
LQ Newbie
 
Registered: Oct 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by schneidz View Post
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
but it will probably tell you that that port is filtered.

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
Yes, it told me that the port is filtered.

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
 
Old 10-29-2012, 02:01 PM   #14
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-19-live-usb/ aix
Posts: 3,822

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
^ 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.

Last edited by schneidz; 10-29-2012 at 02:03 PM.
 
Old 11-06-2012, 07:07 AM   #15
emi_ramo
Member
 
Registered: Apr 2007
Location: Barcelona, Spain
Distribution: Debian, KUbuntu
Posts: 213

Rep: Reputation: 36
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using the Std Out on a remote computer through SSH richman1234 Linux - Newbie 6 09-18-2010 01:41 PM
how do I ssh to a remote computer without password hussa1n Linux - General 9 06-29-2010 06:07 AM
unable to connect to the remote computer mkashif Linux - Networking 3 03-25-2010 01:34 AM
Configuring Remote Desktop In A Computer Remotely senthilmuthiah Linux - Newbie 2 05-04-2009 04:30 AM
Remote login with SSH, but display on remote computer. brodin Linux - Software 3 09-09-2007 03:01 AM


All times are GMT -5. The time now is 12:48 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration