0

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.

0

1 Answer 1

0

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.

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