12
votes

I am trying to access my Linux machine from anywhere in the world. I have tried originally port forwarding and then ssh'ing in; however, I believe my school's WiFi won't allow port forwarding (every time I ran it, it would tell me connection refused). I have setup an account with ngrok and I can remotely SSH in, but now I am wondering if it is possible to RDP. I tried connecting via the Microsoft Remote Desktop app on Mac, but it instantly crashes. I have also looked at trying to connect with localhost, but it's not working. So far, I have tried (with xxxx being the port):

ssh -L xxxx:localhost:xxxx 0.tcp.ngrok.io

and

ssh -L xxxx:localhost:xxxx <user>@0.tcp.ngrok.io

but my computer won't allow it and after about 2 or 3 times, it warns me of a possible DNS Spoofing. Is there anyway that I can run a remote desktop of my linux machine that I have ssh tunneled to (from my mac) on ngrok? Thank you!

1

1 Answers

16
votes

First you'll need to sign up with ngrok if you haven't already and you'll be given an authtoken. You'll need to install this by running

./ngrok authtoken <insert your token here>

This will save your token to a file located ../username/.ngrok/ngrok.yml

Then you'll need to ask ngrok to create a TCP tunnel from their servers to your local machine's Remote Desktop port which should be 3389 by default

ngrok tcp 3389

Give it 30 seconds or so then jump to http://localhost:4040/status to see what the tcp address ngrok has allocated you. It should look something like tcp://1.tcp.ngrok.io:158764

Now you should be able to remote into your machine using address 1.tcp.ngrok.io:158764