4

内网穿透工具ngrok使用教程

 2 years ago
source link: https://blog.51cto.com/qiuyue/5557761
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

内网穿透工具ngrok使用教程

原创

1、ngrok介绍:

ngrok是一款可以将内网IP和端口暴露到公网上的工具,解决了在没有固定公网IP的情况下依然可以从公网访问自己内网的项目,是一个内网穿透的解决方案。

内网穿透工具ngrok使用教程_内网穿透

2、获取Authtoken:

(1)注册账号,并登录;

(2)官网“Download”下载ngrok-v3-stable-linux-amd64.tgz;

(3)登录dashboard,点击左侧“Your Authtoken”,复制右侧的Authtoken:

内网穿透工具ngrok使用教程_内网穿透_02

3、内网CentOS 7.9虚拟机安装Nginx:

# yum -y install epel-release
# yum -y install nginx
# systemctl start nginx
# ss -tunlp | grep -w 80

内网浏览器访问虚机IP(192.168.0.202):

内网穿透工具ngrok使用教程_ngrok_03

4、ngrok安装配置:

# tar -xf /tmp/ngrok-v3-stable-linux-amd64.tgz -C /usr/local/bin
# ngrok config add-authtoken <Authtoken>

内网穿透工具ngrok使用教程_ngrok_04

# cat /root/.config/ngrok/ngrok.yml

内网穿透工具ngrok使用教程_ngrok_05

5、ngrok简单使用:

# ngrok help
内网穿透工具ngrok使用教程_内网穿透_06
# ngrok http 80
内网穿透工具ngrok使用教程_内网穿透_07

公网浏览器访问https://9c69-218-81-32-230.jp.ngrok.io:

内网穿透工具ngrok使用教程_ngrok_08
内网穿透工具ngrok使用教程_ngrok_09
内网穿透工具ngrok使用教程_ngrok_10

Ctrl + c退出


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK