LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Port fowarding through ssh without setting up the router, possible? (https://www.linuxquestions.org/questions/linux-newbie-8/port-fowarding-through-ssh-without-setting-up-the-router-possible-288260/)

Baix 02-09-2005 04:33 PM

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.

Crashed_Again 02-09-2005 04:48 PM

Do you mean changing the port ssh listens on?

Baix 02-09-2005 05:00 PM

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.

:Pengy:

Baix 02-10-2005 05:31 PM

Bumperness

Tinkster 02-10-2005 05:39 PM

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

Baix 02-10-2005 08:40 PM

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

Tinkster 02-10-2005 08:57 PM

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

Baix 02-11-2005 09:51 PM

ohh good point, thanks again


All times are GMT -5. The time now is 04:03 AM.