当前位置:网站首页>Using ngrok on Raspberry Pi (Extra 2)
Using ngrok on Raspberry Pi (Extra 2)
2022-08-09 01:32:00 【probezy】
In the last article, we showed you how to use the command line method to bind a custom domain name to ngrok.This method of operation is usually seen in the case of performing SSH operation on the Raspberry Pi and unable to open the browser to enter the ngrok graphical interface.In contrast, when we are setting up the Raspberry Pi SSH tunnel, we can also use the command line instead of the graphical interface.Now, let's see how it should be done.
After we have obtained the fixed TCP tunnel in the ngrok cloud, we need to return to the local Raspberry Pi to fix the exit of the data tunnel.In the previous introduction (that is, "How to connect to a local Raspberry Pi with ngrok (2)"), we entered "localhost:9200" in the browser of the Raspberry Pi and entered ngrok's Web-UI to operate.Of course, we can also open the command line interface of Raspberry Pi instead of starting ngrok's graphical interface and enter the command
nano /usr/local/etc/ngrok/ngrok.yml
It should be noted here that there is a space between nano and /usr.Open ngrok's configuration file in edit mode (ngrok configuration file is the basis for the normal operation of the program, don't change it if you have nothing to do).
In ngrok's configuration file interface, we find the SSH section.
In this section, we need to add a line of directives
remote_addr: 1.tcp.vip.ngrok.cn:xxxxx
That is, input the data tunnel port generated by ngrok cloud into ngrok's configuration file, let ngrok know which tunnel should enter, which is the correct fixed tunnel.
After the modification is completed, it looks like this
The red xxxxx is the unique data tunnel number, and each tunnel number is different.Of course, the complete tunnel number comes from the fixed TCP address reserved by ngrok cloud, and the port number will be different for each user.
After completing the modification of the configuration file, we can press "ctrl+x" to exit the modification, and press "y" to confirm the modification.To make sure our modifications are correct, we can enter the command "ngrok start ssh" to test.
As long as the following content is displayed, it means that we have successfully modified the ngrok configuration file
At this point, we can use a fixed SSH tunnel to access the Raspberry Pi on the intranet.
After the introduction of two extra articles, I believe that everyone has a certain understanding of the flexibility of ngrok operation, and the data tunnel function provided by ngrok is not limited to remote operation of Raspberry Pi and publishing local web pages to the publicThe Internet can also be used in many aspects such as remote data transmission, applet testing, and remote office.If you have any questions about the use of ngrok, please feel free to contact us, we will certainly provide you with assistance within our ability.Of course, you are also welcome to join ngrok's official VIP group to explore the infinite potential of ngrok together.
边栏推荐
猜你喜欢
随机推荐
入门数据库Days5
Proe/Creo智能硬件产品结构设计要点「干货分享」
PMP有什么答题技巧?
4-6 Matplotlib库 饼图
ABAP 报表中如何以二进制方式上传本地文件
面试秘籍 | 软件测试必备的mysql数据库技术
typescript89-展示任务列表功能
Observer pattern
字节输入流(InputStream)与字节输出流(OutputStream)
低代码开发创新企业应用构建模式
Cmake 报错 Could not find a package configuration file provided by “OpenCV“
requestAnimationFrame实现浏览器动画
《LC刷题总结》—— 二叉树
软件测试的调用接口怎么调用,逻辑是什么?
VS中如何添加依赖的库
4-4 Matplotlib库 直方图
轻量化神经网络--MobileNet v3学习记录
如何仿造一个websocket请求?
【Seata】分布式事务Seata入门与实战
gstreamer 记录