-2

So, I'm using ssh to connect my phone to my pc. I am able to connect when I'm connected to my LAN. so entering like

ssh username@192.168.1.7

will connect and I can list all my directories and everything. but I don't want this. I want to be on my own mobile data plan and access my computer. I go to this site 'whatismyip' I get my public ipv4 address and I do the following code

ssh username@162.122.32.**.**

** are just random number(I don't want to show my public IP to everyone)

the above IP address is the same as my iPhone IP address and my laptop and my android when connected to LAN. I know NAT port does that for its purpose to save IP addresses and that might be the reason why I was not able to connect to my pc.

ok the error I get is

unable to negotiate with 'public IP address' port 22: no matching key found their offer diffie-hellman-group-sha1

So, what I want is when I'm in Singapore I can connect to my laptop(with public IP) which is in India through my phone. I use android. Sorry if it's a noob question. I'm new to Linux and these things just interest me.

Morrison Cole
  • 3,087
  • 1
  • 15
  • 19
Ashutosh Soni
  • 855
  • 3
  • 9
  • 22

1 Answers1

0

The first thing you will need is a public IP at home where your PC is located. If it's dynamic, it will change and you will fail to connect as soon as it does so - which can be in a day/week/month depending on your ISP.

Second - and for you the important part: Is this PC connected directly to your ISP router? Is that actually its IP? Probably not - the common situation is that the PC is located behind a router. In that case you need to: (1)set a static IP for your local PC and (2) set port forwarding on the SSH port to your PC. ^ All that is assuming you have access to the router and are not in a multi user environment like an appartment complex/business environment with it's own intranet, where you can't influence the network setup.

lovrenca
  • 71
  • 4