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.
So I have three machines I want to expose to the outside in order to access them from work and other places.Two of them are already set up and running and have been for some time. One is a CENTOS 6 box running a web server, the other is a PPC mac that I use mostly for files using SFTP.
I have a dyndns account which I use and the router set up to forward ports accordingly, but I want to add another machine on which I do work from home (Ubuntu 14.04), which will allow me to access git repositories remotely. the other box I use for SSH/SFTP won't be suitable for the task so my question is what are my options for adding another machine that uses SSH? Different port or can I use the machine name somehow to get to that box seperate from the other? I'm afraid I'm not quite knowledgable enough about networking to get this one done myself. Any help would be appreciated. thanks
I'm guessing that these boxen are behind a router/firewall; so you knock at your home IP via dyndns and then get routed to internal addresses. If that's the case, it probably is easiest to just use a different port for ssh'ing into each, if it's all the same to you. You can set unique dyndns aliases for each port, and then route it to the correct box you want to use based on what external port you are coming in from.
You can have #1 listen at port 22, #2 port 2200, #3 port 2201, etc. Then forward the ports to the appropriate sshd service.
You can also just have one connection open to the outside, then once logged in, then access the second computer. Or just do it all in one command
If I was trying to login to my server (999.99) then my home computer (192.168.1.23)
You can have #1 listen at port 22, #2 port 2200, #3 port 2201, etc. Then forward the ports to the appropriate sshd service.
You can also just have one connection open to the outside, then once logged in, then access the second computer. Or just do it all in one command
If I was trying to login to my server (999.99) then my home computer (192.168.1.23)
Code:
ssh -t 999.99 ssh 192.168.1.23
that's what I had been doing for some of the other machines on the network which didn't need direct exposure through the firewall. With Git I don't know that that would work. I may have to go with a different port, which is fine. I just wondered if there might be a better way.
I'm guessing that these boxen are behind a router/firewall; so you knock at your home IP via dyndns and then get routed to internal addresses. If that's the case, it probably is easiest to just use a different port for ssh'ing into each, if it's all the same to you. You can set unique dyndns aliases for each port, and then route it to the correct box you want to use based on what external port you are coming in from.
They are yes. One box is set to recieve anything coming in on 80 (CentOS box) and the other is set accept everything on 22 (PPC Mac). Thing is the mac has enough disk for the Git stuff but I've had issues with Git on PPC OS x and really don't have the patience to deal with it and I'd rather have the Git repositories on the machine I do development on. So port 2200 it is.
On the computer currently directly exposed to the web, run sshfs to mount the git repositories you need (within lan right?) so that it is directly accessible through that computer.
e.g.
If my git repos are located at computer A ( 192.168.1.22 ) and my computer B is the one with a ssh service facing the internet, on computer B I would run
Then anyone accessing computer b from the net would be able to access /media/gitrepo without needing to do a second login.
Since you are more or less just trying to access files, this would let you consolidate files into one server without using any extra space.
you can use ssh port forwarding to set up a tunnel to another lan machine rather than forwarding multiple ports in your router.
ssh -L 12345:<lan ip>:22 will allow you to open a 2nd ssh session on your remote workstation using port 12345 and get to the 2nd machine ( ssh -p 12345 localhost ).
On the computer currently directly exposed to the web, run sshfs to mount the git repositories you need (within lan right?) so that it is directly accessible through that computer.
e.g.
If my git repos are located at computer A ( 192.168.1.22 ) and my computer B is the one with a ssh service facing the internet, on computer B I would run
Then anyone accessing computer b from the net would be able to access /media/gitrepo without needing to do a second login.
Since you are more or less just trying to access files, this would let you consolidate files into one server without using any extra space.
This might work, but given that the Mac can't run Git worth spit, I would need to switch the Ubnutu machine as the machine exposed to the outside and then mount a sshfs volume from the mac onto the Ubuntu machine so that both were accessible that way. Thank you for the suggestion. That might be the way to go.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.