LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 02-13-2010, 04:19 PM   #1
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
SSH over Internet help


Okay, so I know this question has been asked before a lot. I'm asking again because I have already been through the search results both here and on Google.

My problem is that I need to do some tech support for my family in a different city. This would all go much faster if I could get some kind of remote shell access. Unfortunately, I can't seem to log into SSH, despite taking the following steps.

* Static IP isn't really an issue, I'm willing to phone them to get their IP address from something like www.whatismyip.com.

* I've seen assurances from our ISP (Windstream) that they are not blocking port 22

* I've user our router (dd-wrt linksys wrt54g) to forward port 22 to that particular computer (which has a static local IP).

* I'm running a liveCD there (systemrescuecd), where I've used the iptables command to allow absolutely everything through. (Yes, it's insecure, but we don't have anything on there worth taking/trashing, and this setup lasts only a day or so). (And yes, I set a root password on the live cd)

* I have the ssh daemon running. It works on the local network - other computers connected to the router can ssh in, just not anyone outside the LAN.


All of the hints I've found so far say to check one of these things. Having done all of them, I still have no access. All my ssh connections time out before I get to a log in screen. Internet access is perfectly normal and operational from that machine.

So any ideas?
 
Old 02-13-2010, 05:20 PM   #2
nuxrl
Member
 
Registered: Jun 2006
Location: NY, USA
Distribution: Slackware, Arch
Posts: 176

Rep: Reputation: 35
Have you checked "LoginGraceTime" field in /etc/ssh/sshd_conf on the server side?
 
Old 02-13-2010, 05:25 PM   #3
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148

Original Poster
Blog Entries: 1

Rep: Reputation: 48
I have not, I'll check that. I didn't think it would be relevant - I thought that meant the amount of time between a login prompt and when the user had to react - I never get the prompt.
 
Old 02-13-2010, 05:42 PM   #4
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148

Original Poster
Blog Entries: 1

Rep: Reputation: 48
I tried setting it to 2 minutes, but it made no difference. My ssh client still just sat there for ~20 seconds, then said that there was a network error and the connection timed out.
 
Old 02-13-2010, 05:43 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Also it could be helpful to attach endpoint-to-endpoint 'tcptraceroute', 'ssh -vvv' and remote sshd output (mask where necessary). Also using iptables to just "-j LOG" (or tcpdump?) on both the filter INPUT and OUTPUT chains might help (plus router logging?) to see if packets actually hit the target.
 
Old 02-13-2010, 05:55 PM   #6
mrclisdue
Senior Member
 
Registered: Dec 2005
Distribution: Slackware
Posts: 1,134

Rep: Reputation: 277Reputation: 277Reputation: 277
I'm actually having an identical issue, and I ultimately feel in my case that it's an issue with the isp on *their* end (don't think the op mentions anything about them.)

Anyway, my point isn't to discover why it won't work, rather to offer a work-around based on a similar issue I had a couple of years back (with the same endpoint isp), and that is to setup openvpn, and use that as a tunnel, whether via ssh or whatnot. I'm about to do the same here, just haven't had the time.

I will mention that the important thing to remember with openvpn is that "float" option for the port has to be in the config on the host (*their*) side, essentially searching for an open port....

I'll also mention that I'd like to see a simpler solution, so please don't let me interrupt further....


cheers,

ps - edit: also like to mention, and you've probably considered, that *they* could tunnel to you, and you could perhaps help that way....

Last edited by mrclisdue; 02-13-2010 at 05:58 PM. Reason: I can't shut up.
 
Old 02-13-2010, 06:38 PM   #7
bret381
Member
 
Registered: Nov 2009
Location: Alabama
Distribution: Arch x86_64
Posts: 650

Rep: Reputation: 79
I agree with mrclisdue. I believe it is going to be the ISP. Try changing the ssh server to run on port 443. You could also run an nmap scan of your local network to make sure that port 22 is actually open.
 
Old 02-13-2010, 06:53 PM   #8
reed9
Member
 
Registered: Jan 2009
Location: Boston, MA
Distribution: Arch Linux
Posts: 653

Rep: Reputation: 142Reputation: 142
On the server side, have you set /etc/hosts.allow to accept incoming connections?

The simplest and least secure method is to add
Code:
sshd: ALL
to /etc/hosts.allow
 
Old 02-13-2010, 07:00 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You said that you forwarded port 22 to your computer. Has this been done on the other side as well? It is the server that needs port 22 opened not the client. (unless you block outgoing traffic)

A cheap way to check input connectivity is "telnet <IP> <port>". You should see a response like:
Trying 192.168.1.106...
Connected to elite.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.2

Also try using nmap to see which ports are open on the server.
Make sure they are running the sshd server.
Make sure their firewall isn't blocking port 22.
 
Old 02-13-2010, 10:24 PM   #10
nuxrl
Member
 
Registered: Jun 2006
Location: NY, USA
Distribution: Slackware, Arch
Posts: 176

Rep: Reputation: 35
OK, I thought you meant the login timed out.

Like others have suggested, if you can ping the target IP from you PC and port 22 is forwarded in the router, most likely the ISP is blocking that port.
 
Old 02-13-2010, 10:37 PM   #11
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
You could use tcpdump on the ssh server to see if any ssh packets are reaching it. If not you would then know the problem is either with your ISP or with your router. Sorry, I am not familiar with the tcpdump command so cannot suggest which options to use.
 
Old 02-19-2010, 11:35 AM   #12
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148

Original Poster
Blog Entries: 1

Rep: Reputation: 48
Thanks for all of your help. It turns out that there was a second side to this issue that I had not considered. The ISP of the server was fine, but the ISP of the client (Campus Technologies, to whom my university farms out internet access) has a habit of blocking everything but port 80, even outbound. I suspect that once I fight this out with them to get 22 unblocked on the client side, things will improve. I'll look for another internet connection to test this theory with.
 
  


Reply



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
SSH and Samba over internet FNC Linux - Networking 5 10-25-2007 08:49 AM
ssh on internet ramesh.mimit Linux - Security 1 12-07-2006 01:31 PM
SSH - How can i alllow someone SSH to my network from Internet - please help me b:z Linux - Networking 4 04-05-2005 07:21 AM
what is SSH, something to do with internet? BajaNick Linux - General 8 07-12-2004 11:57 PM
SSH Internet Problem alimharji Linux - Networking 1 02-02-2004 01:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:03 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration