https://github.com/ehang-io/nps/releases

https://ehang-io.github.io/nps/


---服务端

chmod -R 777  /data/site/htmltoo.opt/nps

cd   /data/site/htmltoo.opt/nps/server

./nps install

./nps uninstall

ps -ef | grep nps

killall nps

rm -rf /etc/nps

./nps reload

./nps -version

./nps update

./nps restart

nps start|stop|restart|uninstall|update or nps-update update

/var/log/nps.log

/etc/nps/conf/nps.conf

-开启

./nps start

./nps stop

-

/data/site/htmltoo.opt/nps/server/web/

-生效页面

/etc/nps/web/

-数据

/etc/nps/conf/*.json


访问服务端ip:web服务端口(默认为8080)

使用用户名和密码登陆(默认admin/123,正式使用一定要更改)

-添加客户端:加密: 是 压缩: 是 允许客户端通过配置文件连接: 是 

客户端命令: 

./npc -server=g.htmltoo.com:8024 -vkey=HtmlToo8024 -type=tcp

-添加TCP隧道


http://g.htmltoo.com:8089


vi  /opt/nps/conf/nps.conf

runmode = pro
bridge_port=9024
#web
web_host=g.htmltoo.com
web_username=ihunter
web_password=wdqdmm@0
web_port = 8089


--客户端

cd  /data/site/htmltoo.opt/nps/npc

chmod -R 777  /data/site/htmltoo.opt/

./npc  -version


-无配置文件模式

-服务端->客户端命令

./npc install 其他参数(例如-server=xx -vkey=xx或者-config=xxx)

./npc uninstall

/var/log/npc.log

npc-update update

-注册到系统服务(开机启动、守护进程)

./npc install  -server=s.htmltoo.com:9024 -vkey=HtmlToo9024 -type=tcp

./npc -config=npc配置文件路径

ps -ef | grep npc

killall npc

-启动:

./npc start

./npc stop


#  firewalld服务

vi /etc/firewalld/services/tcp.xml

<service>
  <short>tcp</short>
  <description>tcp</description>
  <port protocol="tcp" port="80"/>
  <port protocol="tcp" port="443"/>
</service>

-才能添加这个服务

firewall-cmd --zone=public --permanent --add-service=tcp

firewall-cmd --zone=public --permanent --remove-service=tcp

firewall-cmd --reload


netstat -plnt  | grep nps >> /opt/nps.txt

awk '{print $4}' /opt/nps.txt >> /opt/nps.log


# EE

\d\d\d\d\d  --->  <port protocol="tcp" port="\0"/>


/etc/systemd/system/Nps.service

[Unit]
Description=AAA。
ConditionFileIsExecutable=/usr/bin/nps
 
Requires=network.target  
After=network-online.target syslog.target 
[Service]
LimitNOFILE=65536
StartLimitInterval=5
StartLimitBurst=10
ExecStart=/usr/bin/nps "service"
Restart=always
RestartSec=120
[Install]
WantedBy=multi-user.target


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回