Linux - Networking This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
09-28-2005, 10:34 PM
|
#1
|
Member
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 390
Rep:
|
ssh port forwarding question
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?
Thanks for the help.
|
|
|
09-28-2005, 10:51 PM
|
#2
|
Senior Member
Registered: Jun 2004
Distribution: Arch, Debian, Slack
Posts: 1,016
Rep:
|
port 22 is the default, so you don't have to specify it. if you change the sshd port number, you specify it with -p, for example:
$ ssh -l user IP -p 1234
|
|
|
09-29-2005, 08:52 AM
|
#3
|
Member
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 390
Original Poster
Rep:
|
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?
|
|
|
09-29-2005, 03:29 PM
|
#4
|
LQ Newbie
Registered: Sep 2005
Posts: 10
Rep:
|
Quote:
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.
|
|
|
09-29-2005, 03:32 PM
|
#5
|
Member
Registered: Dec 2003
Location: Maryland
Distribution: Fedora, Ubuntu, Centos, FreeBSD
Posts: 390
Original Poster
Rep:
|
I didn't see the error about the host key changing and everything worked well. Thank you for all of your help.
|
|
|
All times are GMT -5. The time now is 03:50 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|