LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-09-2005, 04:33 PM   #1
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Rep: Reputation: 30
Port fowarding through ssh without setting up the router, possible?


Hey all,
I was wondering if there was anyway to ssh to a remote computer on a lan without setting up the router. Is there a way to specify to ssh what local machine on the lan it should go to? If i'm not making any sense just tell me and i'll try to clarify lol.
Thanks in advance.
 
Old 02-09-2005, 04:48 PM   #2
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
Do you mean changing the port ssh listens on?
 
Old 02-09-2005, 05:00 PM   #3
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
No, let me try to explain a bit better.

I'm connecting to my computer via ssh from my friends house (which i've done many times before) however my router is set up to forward ssh requests on port 22 to the local computer on the LAN 192.168.0.4. The problem is that my linux computer's ip address has changed to 192.168.0.8 and i have no way of remotly accessing my router to make the change needed. Is there an option that would allow me to tell ssh to forward itself to the 192.168.0.8? This would also allow me to take out the port forwarding option in my router and manually enter the number.

The reason i think there must be a way is what would happen if i had two linux machines on one LAN, how would I tell ssh which one to connect to when connecting remotely?

Something like:
ssh me@24.184.55.55 -name/ip_of_local_computer=192.168.0.8
which obviously wouldn't work but i hope it helps clarify what i'm looking for.

 
Old 02-10-2005, 05:31 PM   #4
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
Bumperness
 
Old 02-10-2005, 05:39 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
And the answer is NO

ssh can't trigger anything on the router,
and from within an IP packet you can't
change the destination in the receiving
machine (or at least I hope one can't, it
would render all firewalls pretty pointless ;})


Cheers,
Tink
 
Old 02-10-2005, 08:40 PM   #6
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
Thanks for the answer. If I had two computers running the ssh daemon on the sam LAN at the same time and i wanted to connect to one of them remotely I'd either have to connect to the one which the router is set up to forward ssh requests to or neither of them? Well that certainly stinks lol.

Once again, thanks for the info Tink
 
Old 02-10-2005, 08:57 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Well, you could set-up port forwarding to two DIFFERENT
ports, and tell ssh on the client to use a different port for
each machine ... ? If that's too much hassle you can still
just ssh from one client to the other once you're past the
router ...


Cheers,
Tink

Last edited by Tinkster; 02-13-2005 at 02:03 PM.
 
Old 02-11-2005, 09:51 PM   #8
Baix
Member
 
Registered: Jun 2004
Distribution: Gentoo, LFS, Slackware
Posts: 203

Original Poster
Rep: Reputation: 30
ohh good point, thanks again
 
  


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
Port Fowarding zaicheke *BSD 9 10-25-2004 06:05 PM
Open port ssh with modem router dicou Linux - Newbie 12 05-23-2004 03:08 PM
router port forwarding/ssh epoo Slackware 7 12-30-2003 03:02 PM
Fowarding port 80 ? Drogo Linux - Networking 13 05-28-2003 03:16 AM
SSH port fowarding magyartoth Linux - Networking 10 05-01-2002 02:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:25 AM.

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