Unable to ssh into remote Linux by ngrok

徘徊边缘 提交于 2020-01-11 15:49:06

问题


The remote Linux computer is in an internal network and has no public IP address. So I installed ngrok.

ngrok tcp 22

ngrok by @inconshreveable (Ctrl+C to quit) Tunnel Status online
Version 2.0.19/2.0.17
Web Interface http://127.0.0.1:4040
Forwarding tcp://0.tcp.ngrok.io:36428 -> localhost:22
Connections ttl opn rt1 rt5 p50 p90
0 0 0.00 0.00 0.00 0.00

I checked that sshd is running.

At the local PC, I tried

ssh myuser@ngrok.com -p36428

which gave rise to

ssh: connect to host ngrok.com port 36428: Connection refused


回答1:


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).

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.



来源:https://stackoverflow.com/questions/30577729/unable-to-ssh-into-remote-linux-by-ngrok

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!