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.

This question already has an answer here:

I have set up simple ssh server by using openssh on my Ubuntu.

I tried to ssh it from my Mac, which successful. But my mac is in the same subnet, which behind same router at my home. my ubunut local ip is 192.168.1.* My outgoing ip is 71..*.**

Now, I want be able to ssh my desktop even from my friend's home.

What should I do?

Obviuosly, by doing ssh username@71...* wont work. Since there are 3,4 computers are using the same ip behind my route.

share|improve this question

marked as duplicate by slhck May 11 '13 at 20:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

1 Answer 1

The problem is that you are using a kludge called NAT to connect multiple computers behind a single IP. This prevents you from selecting a specific computer in your local network when you connect from the outside (since you only have a single IP to select).

However if you have control over your firewall (cq the firewall in your router/gateway/modem/switch combination) then you can use port forwarding. Basically telling it to forward all incoming connection to 71.x.x.x port 22 to the local computer with ip 192.168.1.x port 22.

Note that you can only do this for a single computer and that you want that computer to have a fixed IP (e.g. make a reservation for that MAC in the DHCP server, or configure a static IP). Otherwise you will need to change the firewall rules every time your servers gets a new IP.

share|improve this answer
add comment

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