使用NPS搭建内网穿透

1.准备

准备一台服务器,比如:阿里云,腾讯云等等

2.下载NPS

我的服务器是Linux系统,Windows需进入其官网下载
nps官网

wget https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz
image.png

解压

tar -zxf linux_amd64_server.tar.gz

安装

./nps install
[root@iZ2ze4kh3gm5ijfq7lpr8cZ mydata]# tar -zxf linux_amd64_server.tar.gz
[root@iZ2ze4kh3gm5ijfq7lpr8cZ mydata]# ./nps install
2023/11/30 10:30:40 copy file ::/mydata/conf/clients.json to /etc/nps/conf/clients.json
2023/11/30 10:30:40 copy file ::/mydata/conf/hosts.json to /etc/nps/conf/hosts.json
2023/11/30 10:30:40 copy file ::/mydata/conf/nps.conf to /etc/nps/conf/nps.conf
2023/11/30 10:30:40 copy file ::/mydata/conf/server.key to /etc/nps/conf/server.key
2023/11/30 10:30:40 copy file ::/mydata/conf/server.pem to /etc/nps/conf/server.pem
2023/11/30 10:30:40 copy file ::/mydata/conf/tasks.json to /etc/nps/conf/tasks.json
2023/11/30 10:30:40 copy file ::/mydata/web/views/client/add.html to /etc/nps/web/views/client/add.html
2023/11/30 10:30:40 mkdir:/etc/nps/web/views/client/
2023/11/30 10:30:40 copy file ::/mydata/web/views/client/edit.html to /etc/nps/web/views/client/edit.html
2023/11/30 10:30:40 copy file ::/mydata/web/views/client/list.html to /etc/nps/web/views/client/list.html
2023/11/30 10:30:40 copy file ::/mydata/web/views/index/add.html to /etc/nps/web/views/index/add.html
2023/11/30 10:30:40 mkdir:/etc/nps/web/views/index/
2023/11/30 10:30:40 copy file ::/mydata/web/views/index/edit.html to /etc/nps/web/views/index/edit.html
2023/11/30 10:30:40 copy file ::/mydata/web/views/index/hadd.html to /etc/nps/web/views/index/hadd.html
2023/11/30 10:30:40 copy file ::/mydata/web/views/index/hedit.html to /etc/nps/web/views/index/hedit.html
2023/11/30 10:30:40 copy file ::/mydata/web/views/index/help.html to /etc/nps/web/views/index/help.html
2023/11/30 10:30:40 copy file ::/mydata/web/views/index/hlist.html to /etc/nps/web/views/index/hlist.html
2023/11/30 10:30:40 copy file ::/mydata/web/views/index/index.html to /etc/nps/web/views/index/index.html
2023/11/30 10:30:40 copy file ::/mydata/web/views/index/list.html to /etc/nps/web/views/index/list.html
2023/11/30 10:30:40 copy file ::/mydata/web/views/login/index.html to /etc/nps/web/views/login/index.html
2023/11/30 10:30:40 mkdir:/etc/nps/web/views/login/
2023/11/30 10:30:40 copy file ::/mydata/web/views/login/register.html to /etc/nps/web/views/login/register.html
2023/11/30 10:30:40 copy file ::/mydata/web/views/public/error.html to /etc/nps/web/views/public/error.html
2023/11/30 10:30:40 mkdir:/etc/nps/web/views/public/
2023/11/30 10:30:40 copy file ::/mydata/web/views/public/layout.html to /etc/nps/web/views/public/layout.html
2023/11/30 10:30:40 copy file ::/mydata/web/static/css/bootstrap-table.min.css to /etc/nps/web/static/css/bootstrap-table.min.css
2023/11/30 10:30:40 mkdir:/etc/nps/web/static/css/
2023/11/30 10:30:40 copy file ::/mydata/web/static/css/bootstrap.min.css to /etc/nps/web/static/css/bootstrap.min.css
2023/11/30 10:30:40 copy file ::/mydata/web/static/css/datatables.css to /etc/nps/web/static/css/datatables.css
2023/11/30 10:30:40 copy file ::/mydata/web/static/css/fontawesome.min.css to /etc/nps/web/static/css/fontawesome.min.css
2023/11/30 10:30:40 copy file ::/mydata/web/static/css/regular.min.css to /etc/nps/web/static/css/regular.min.css
2023/11/30 10:30:40 copy file ::/mydata/web/static/css/solid.min.css to /etc/nps/web/static/css/solid.min.css
2023/11/30 10:30:40 copy file ::/mydata/web/static/css/style.css to /etc/nps/web/static/css/style.css
2023/11/30 10:30:40 copy file ::/mydata/web/static/img/flag/en-US.png to /etc/nps/web/static/img/flag/en-US.png
2023/11/30 10:30:40 mkdir:/etc/nps/web/static/img/
2023/11/30 10:30:40 mkdir:/etc/nps/web/static/img/flag/
2023/11/30 10:30:40 copy file ::/mydata/web/static/img/flag/zh-CN.png to /etc/nps/web/static/img/flag/zh-CN.png
2023/11/30 10:30:40 copy file ::/mydata/web/static/js/bootstrap-table-locale-all.min.js to /etc/nps/web/static/js/bootstrap-table-locale-all.min.js
2023/11/30 10:30:40 mkdir:/etc/nps/web/static/js/
2023/11/30 10:30:40 copy file ::/mydata/web/static/js/bootstrap-table.min.js to /etc/nps/web/static/js/bootstrap-table.min.js
2023/11/30 10:30:40 copy file ::/mydata/web/static/js/bootstrap.min.js to /etc/nps/web/static/js/bootstrap.min.js
2023/11/30 10:30:40 copy file ::/mydata/web/static/js/echarts.min.js to /etc/nps/web/static/js/echarts.min.js
2023/11/30 10:30:40 copy file ::/mydata/web/static/js/fontawesome.min.js to /etc/nps/web/static/js/fontawesome.min.js
2023/11/30 10:30:40 copy file ::/mydata/web/static/js/inspinia.js to /etc/nps/web/static/js/inspinia.js
2023/11/30 10:30:40 copy file ::/mydata/web/static/js/jquery-3.4.1.min.js to /etc/nps/web/static/js/jquery-3.4.1.min.js
2023/11/30 10:30:40 copy file ::/mydata/web/static/js/language.js to /etc/nps/web/static/js/language.js
2023/11/30 10:30:40 copy file ::/mydata/web/static/js/popper.min.js to /etc/nps/web/static/js/popper.min.js
2023/11/30 10:30:40 copy file ::/mydata/web/static/page/error.html to /etc/nps/web/static/page/error.html
2023/11/30 10:30:40 mkdir:/etc/nps/web/static/page/
2023/11/30 10:30:40 copy file ::/mydata/web/static/page/languages.xml to /etc/nps/web/static/page/languages.xml
2023/11/30 10:30:40 copy file ::/mydata/web/static/webfonts/fa-solid-900.eot to /etc/nps/web/static/webfonts/fa-solid-900.eot
2023/11/30 10:30:40 mkdir:/etc/nps/web/static/webfonts/
2023/11/30 10:30:40 copy file ::/mydata/web/static/webfonts/fa-solid-900.svg to /etc/nps/web/static/webfonts/fa-solid-900.svg
2023/11/30 10:30:40 copy file ::/mydata/web/static/webfonts/fa-solid-900.ttf to /etc/nps/web/static/webfonts/fa-solid-900.ttf
2023/11/30 10:30:40 copy file ::/mydata/web/static/webfonts/fa-solid-900.woff to /etc/nps/web/static/webfonts/fa-solid-900.woff
2023/11/30 10:30:40 copy file ::/mydata/web/static/webfonts/fa-solid-900.woff2 to /etc/nps/web/static/webfonts/fa-solid-900.woff2
2023/11/30 10:30:40 install ok!
2023/11/30 10:30:40 Static files and configuration files in the current directory will be useless
2023/11/30 10:30:40 The new configuration file is located in /etc/nps you can edit them
2023/11/30 10:30:40 You can start with:
nps start|stop|restart|uninstall|update or nps-update update
anywhere!

启动

nps start

3 访问

image.png

4 创建客户端

image.png
image.png

5 创建隧道

image.png

image.png

6 进行本地连接

继续下载windows 的windows_amd64_client.tar.gz,我的本地是Windows 的


image.png
image.png

之后就是访问你的服务器


image.png

这样一个内网穿透就配好了

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 211,817评论 6 492
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,329评论 3 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 157,354评论 0 348
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,498评论 1 284
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,600评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,829评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,979评论 3 408
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,722评论 0 266
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,189评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,519评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,654评论 1 340
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,329评论 4 330
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,940评论 3 313
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,762评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,993评论 1 266
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,382评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,543评论 2 349

推荐阅读更多精彩内容