Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is there a way that I can port forward an ssh connection to another machine on my network?
I would like to ssh into my machine at home that has 22 open on my router and then be able to open another terminal and ssh to any other machine on my local network at home through my already open ssh connection.
I created an ssh script that had something to this affect:
-L 6000:IP ADDRESS OF MACHINE ON HOME NETWORK:22
If that is supposed to work then maybe I am not typing my ssh command properly. If that is so can anyone tell me how to ssh to a specific port?
So if Im specifying that ssh command is that something I do once I am authenticated to my home network from another terminal or is that something I change in my ssh script?
I would like to ssh into my machine at home that has 22 open on my router and then be able to open another terminal and ssh to any other machine on my local network at home through my already open ssh connection.
I created an ssh script that had something to this affect:
-L 6000:IP ADDRESS OF MACHINE ON HOME NETWORK:22
If that is supposed to work then maybe I am not typing my ssh command properly. If that is so can anyone tell me how to ssh to a specific port?
From the command line, you can type in
Code:
ssh -L 6000:IP ADDRESS OF MACHINE ON HOME NETWORK:22 username@home_external_ip
Then, from another terminal, you can do
Code:
ssh -p 6000 username@localhost
and your connection will automatically be forwarded to port 22 on IP ADDRESS OF MACHINE ON HOME NETWORK.
If you see an error about a host key having changed, let me know and we'll work through that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.