Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At home I have a linux machine behind a router. How can I ssh it?

share|improve this question

migrated from Nov 13 '09 at 9:32

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

This question is better suited to – Dominic Rodger Nov 13 '09 at 8:43

You need to do two things:

  1. Set up a dynamic dns service. The service is free, and generally you can set this up in your router's configuration (ie, once you've set up an account at, many routers let you put in your account information and your router will update it automatically). This will let you do something like ssh (or whatever you sign up for), and you won't have to memorize your router's IP address (which is likely to change if you're using a residential service)

  2. Set up port forwarding. SSH is configured to use port 22 by default, so set up your router to forward port 22 to your computer. If you don't know how to set up port forwarding, check your router's documentation - it's usually pretty easy.

share|improve this answer
RE to Point 1: Would setting up the hostname in /etc/hosts accomplish the same thing? – new123456 Jun 11 '11 at 16:14

You need to enable port forwarding for port 22 on your router. The details can depend on router model, so, unfortunately, I cannot give more specific instructions. You can check, for example,, it has port forwarding howtos for many router models.

share|improve this answer

You can publish one or more services using port forwarding on your router. So to publish a web server on your computer you'll probably want to forward port 80. Check about this in your router's manual.

share|improve this answer

You can't (at least not without configuring your router: it needs to forward port 22 to the PC you want to SSH on)

share|improve this answer

If you can't / don't want forward port 22 on you router, and have another machine on the Iternet, you could always do the ssh reverse tunnel: here

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .