-2

Hi I have a pc in my home with Ubuntu os and ssh installed in it.

I want to access my pc from other location.

ssh user@999.999.9.99(my pc ip address) 

This will work when i try to access when using same network.

what changes need to be done to access my pc from any where and from any network

  • You need to forward a port in your router directing ssh request to the correct pc. Also you can't use the same IP locally and remotely (assuming locally you used something like 192.168.x.x), you can find what IP to use on http://www.whatsmyip.org/. Lastly, this question is not programming related and would be better asked on SuperUser – Aidin Nov 30 '16 at 07:21
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306) – jww Nov 30 '16 at 08:13

1 Answers1

-2

Locally I assume you use an IP like 192.168.x.x. When on a local network you can send requests to all connected devices directly and they all normally have an IP like 192.168.x.x. You don't have access to them directly outside of your network.

To access the same PC remotely you need to forward a port in your router.

  • Login to your router interface, typically on 192.168.1.1 (or similar)
  • Go to WAN settings and do a portforwarding:
    • Port 22 for SSH
    • Use the same IP as you used to connect through SSH locally
  • Now you need to find your outgoing IP, the adress to your network.

Now when you are on a remote network you can do the same as you did previously but with the outgoing IP.

ssh user@out.going.I.P

Aidin
  • 1,230
  • 2
  • 11
  • 16