How to remote access using command line to a computer using dynamic IP?

3

1

I want to access my other computer (mac osx) which on the other place. The simples solution is maybe like using teamviewer and logmein, but in this case i want to remote using command line /terminal. The problem teamviewer and logmein don't support terminal session. The remote computer (the computer that i want to connect to) is using dynamic IP and i don't have access to the router connected to that computer.

I got some resource , that i can use dynamic dns services like dynu,no-ip etc, but most of these services need me to alter some setting in the router (for example doing port forwarding etc). The fact i don't have access to the router. Or am i missing something ?

Any solution ?

andio

Posted 2015-12-05T18:23:45.330

Reputation: 201

1You should consider a reverse tunnel with ssh. – MariusMatutiae – 2015-12-05T18:39:10.593

I agree with Marius, your only solution is for the computer in question to call out to another machine and then you meet in the middle. If reverse SSH won't work back to your own machine, figure out how to get a third server and connect to that. Sorry, I don't have specific software recommendations. You might have to cobble bits together. I'm imagining a listener that connects two ends of two streams, like an old fashioned telephone operator. – Andrew Philips – 2015-12-05T19:24:32.097

Thanks Andrew and Marius. This is a good start , i will google for 'reverse ssh' and be back with the result. Thanks a lot guyz. Btw if anyone got other advices , pls share with me here. – andio – 2015-12-06T12:10:16.963

Answers

2

If you want to connect you have 2 main options:

  1. Use your own server to get around NAT, for this you would use reverse SSH tunneling, either direct to your machine if you are not behind NAT, or to a midpoint like in the tutorial linked if you are also behind NAT.

  2. Using a service like ngrok to give you a publicly accessible address for connecting to

jrtapsell

Posted 2015-12-05T18:23:45.330

Reputation: 408

Well, I guess, to be fair, I should ask you, too:   Are you affiliated with this ngrok service?  (This is the second time this month you have promoted it.)  If you are affiliated, you must say so.

– Scott – 2017-09-28T19:21:58.050

1I am not, although if they wish to start paying me I wouldn't say no :p (although I would disclose if I was).

If I found a service I thought did the same thing better I would recommend them instead. – jrtapsell – 2017-09-28T19:24:45.193