简体   繁体   English

无法通过ngrok SSH到远程Linux

[英]Unable to ssh into remote Linux by ngrok

The remote Linux computer is in an internal network and has no public IP address. 远程Linux计算机位于内部网络中,没有公共IP地址。 So I installed ngrok. 所以我安装了ngrok。

ngrok tcp 22

ngrok by @inconshreveable (Ctrl+C to quit) Tunnel Status online ngrok by @inconshreveable(Ctrl + C退出)在线隧道状态
Version 2.0.19/2.0.17 版本2.0.19 / 2.0.17
Web Interface http://127.0.0.1:4040 Web界面http://127.0.0.1:4040
Forwarding tcp://0.tcp.ngrok.io:36428 -> localhost:22 转发tcp://0.tcp.ngrok.io:36428-> localhost:22
Connections ttl opn rt1 rt5 p50 p90 连接ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00 0 0 0.00 0.00 0.00 0.00 0.00

I checked that sshd is running. 我检查了sshd是否正在运行。

At the local PC, I tried 在本地PC上,我尝试过

ssh myuser@ngrok.com -p36428

which gave rise to 这引起了

ssh: connect to host ngrok.com port 36428: Connection refused ssh:连接到主机ngrok.com端口36428:连接被拒绝

You are connecting to the wrong destination address. 您连接到错误的目标地址。 The command should be 该命令应该是

ssh myuser@0.tcp.ngrok.io -p36428

Notice the different hostname (ie 0.tcp.ngrok.io instead of ngrok.com ). 请注意不同的主机名(即0.tcp.ngrok.io而不是ngrok.com )。

And generally you would want to put the user@hostname after all the options (eg -p36428 ), even though it doesn't generally cause any issues. 通常,您通常希望将user@hostname放在所有选项之后(例如-p36428 ),即使通常不会引起任何问题。

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

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