Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a home network setup behind a NAT router with two linux boxes. Occasionally, I want to ssh to them from outside the home network, but neither have a public IP address. What's your recommendation?

Currently, I have setup a dynamic DNS record for the router, which reroutes all remote connections to one server. If I do want to ssh to the other server, I first ssh to the first server, and then ssh from the first to the second.

Is there an option to connect to either of the servers directly through ssh tunneling or virtual domains and such?

share|improve this question

4 Answers 4

up vote 9 down vote accepted

You can always port forward and use a separate port for each machine. In /etc/ssh/sshd_config Change the line that says:

port 22

to whatever you wish. Different for each machine obviously. You could use 22222 for one and 22223 for the other. Then you can run ssh -p 22222 user@1.2.3.4 for example, or within PuTTY change the port.

Make sure to restart the sshd service after changing this so it re-reads the configuration file

share|improve this answer

Easiest would be to change the port SSH listens to on the internal network, and forward those IPs to the correct internal box.

share|improve this answer

You can remotely access SSH shell to your computer without IP Public using desktop or just a smart phone (e.g. Android) by installing robotito in your computer that u want to access SSH remotely.

  • This will allow you to access SSH using from Google Talk Client Apps anywhere.
  • There is no need for a public IP address or special setting.
  • I'ts Free and Open Source, Not Paying any application services anymore.

I made a script (tested on my raspbian OS in Raspberry Pi) so u can easily install robotito on Raspberry Pi, Debian or Ubuntu Box(debian package distribution). this is the steps to get your linux box remotable:

  1. Open Shell Command or u can call it Terminal, go to your home folder, Download installer script by command :

    $wget https://opengateway.googlecode.com/files/robotito

  2. after that running the script by entering command :

    $sudo ./robotito

  3. and then you can edit file credentials.rb from config folder if robotito using your gtalk account and save it by pressing ctrl+x and y . Default is using nano editor.

  4. running the robotito from robotito folder by command

    $cd robotito

    $./jabbershd start

  5. Now that this is done you can use ssh from any google talk client, don't forget to add the robotito gtalk account to your google talk account and test it with chatting each other before using the account.

share|improve this answer

You can definatly use SSH tunneling, If you are using OpenSSH, you can specify

-Lsomeport:other.host.internal.ip:otherHostSSHPort

on the command line, or after issueing

<NEWLINE>~C

and then in another terminal

ssh localhost -p someport
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.