Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Basically, how do I do it?

I'd like to connect to my home computer from work, but my internet is routed through my apartment building's network, so I don't have the static IP address I'm accustomed to having.

How do I go about accessing my home computer through SSH (I'll be using Putty at work if it matters) if my home computer doesn't have a static IP address?

share|improve this question

migrated from stackoverflow.com May 25 '10 at 3:44

This question came from our site for professional and enthusiast programmers.

1  
Even with a dynamic IP, my server (in another country) tends to change IP so infrequently that the host often times out on no-ip.com. The bigger problem is that "apartment building's network" suggests you're behind a NAT, so simply knowing your IP-address-du-jour may not be enough. –  tc. May 25 '10 at 1:37
    
@tc howtoforge.com/reverse-ssh-tunneling –  aaa May 25 '10 at 1:40

6 Answers 6

up vote 5 down vote accepted

I think you may want to look into a service that can provide you with a dns domain name for your home computer. The following is one I have used with great success over the years: DynDNS.com

Basically, they use a service that runs on your computer that will update the dns record whenever the IP address of your home computer/router changes.

share|improve this answer
    
Thanks for the referral. My problem is that I don't really have an external IP address. The building's router does some fancy pants stuff (as @tc suggested, a NAT) so that I don't have a single IP address. Help? –  Steven Xu May 25 '10 at 1:43
    
@Steven: So your problem is not the absence of a static IP address, your problem is the absence of any public IP address. I think the wording of your question is confusing some people. –  David Z May 25 '10 at 6:03

Within your LAN, set your router to forward the required ports to your local computer's IP/host. Then get the DynDNS service to acquire a hostname for your router. If the router's external IP is dynamic, use ddclient to auto-update when new addresses are assigned.

share|improve this answer

You're unable to get to your computer because you're behind a NAT'ing system of some sort. In other words, your computer is on a private, internal network and being NAT'd via the building's NAT device, under their control so there is no easy way to get back in, in this sense.

One way would be to create a reverse SSH tunnel initiated from your workstation, outbound over the Internet, destined to an ssh daemon that you can connect to from home.

Once this is established, then you can ssh to localhost that you set up the reverse tunnel on (which would be redirected, via the reverse tunnel) to your system, from the ssh host that you connected to, via the reverse tunnel.

Hope this helps?

Afterwards, you may want to look into writing a small script for a cronjob to keep this connection alive, reconnect on disconnect, etc. and use ssh-agent properly, for passwordless connections - if set up properly, the passphrase would only need to be set once (if that).

share|improve this answer

You can try using something like STUN or some other NAT punch-through tool.

share|improve this answer

you might find it easier to use a service such as hamachi or other zero-config vpn solutions. Join the two machines into the same vpn network, and ssh into its hamachi IP.

share|improve this answer

the quickest and cleanest solution to solve this, to access SSH shell to your computer without IP Public from 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.
  • No need to open SSH port (keep your computer save)
  • No need to open any tunneling (e.g. VPN or somethink like that)

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

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.