简体   繁体   English

SSH隧道到Ngrok并启动RDP

[英]SSH Tunnel to Ngrok and Initiate RDP

I am trying to access my Linux machine from anywhere in the world. 我试图从世界上任何地方访问我的Linux机器。 I have tried originally port forwarding and then ssh'ing in; 我尝试过最初的端口转发,然后ssh'ing; however, I believe my school's WiFi won't allow port forwarding (every time I ran it, it would tell me connection refused). 但是,我相信我学校的WiFi不允许端口转发(每次我运行时,都会告诉我连接被拒绝)。 I have setup an account with ngrok and I can remotely SSH in, but now I am wondering if it is possible to RDP. 我已经设置了一个ngrok帐户,我可以远程SSH,但现在我想知道是否有可能RDP。 I tried connecting via the Microsoft Remote Desktop app on Mac, but it instantly crashes. 我尝试通过Mac上的Microsoft远程桌面应用程序进行连接,但它立即崩溃。 I have also looked at trying to connect with localhost, but it's not working. 我也看过尝试连接localhost,但它不起作用。 So far, I have tried (with xxxx being the port): 到目前为止,我已经尝试过(使用xxxx作为端口):

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. 但是我的计算机不会允许它,大约2到3次后,它会警告我可能存在DNS欺骗。 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? 无论如何,我可以运行我的linux机器的远程桌面,我在ngrok上通过隧道(从我的mac)进行隧道传输? Thank you! 谢谢!

First you'll need to sign up with ngrok if you haven't already and you'll be given an authtoken. 首先你需要注册ngrok,如果你还没有,你会得到一个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 这会将您的令牌保存到位于../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

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. 给它30秒左右然后跳转到http://localhost:4040/status以查看ncpk为你分配的tcp地址。 It should look something like tcp://1.tcp.ngrok.io:158764 它看起来应该像tcp://1.tcp.ngrok.io:158764

Now you should be able to remote into your machine using address 1.tcp.ngrok.io:158764 现在,您应该可以使用地址1.tcp.ngrok.io:158764远程访问您的计算机

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM