Linux安装NPS内网穿透

LG5 2022-12-20 179 12/20

一、服务器端配置nps

1、下载解压nps

mkdir -p /nps/server  #创建多级目录
cd /nps/server
#下载到server目录下并解压(原版下载地址)
wget https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz
修改漏洞后版本:
wget https://github.com/yisier/nps/releases/download/v0.27.01/linux_amd64_server.tar.gz
#解压
tar -zxvf linux_amd64_server.tar.gz

2、安装配置nps

#安装nps
./nps install
 
#配置nps
vim /etc/nps/conf/nps.conf
#仅需修改web的host、账号、密码和端口号即可
appname = nps
#Boot mode(dev|pro)
runmode = dev

#HTTP(S) proxy port, no startup if empty
http_proxy_ip=0.0.0.0
http_proxy_port=80
https_proxy_port=443
https_just_proxy=true
#default https certificate setting
https_default_cert_file=conf/server.pem
https_default_key_file=conf/server.key

##bridge
bridge_type=tcp
#客户端连接端口
bridge_port=8024
bridge_ip=0.0.0.0

# Public password, which clients can use to connect to the server
# After the connection, the server will be able to open relevant ports and parse related domain names according to its own configuration file.
public_vkey=123

#Traffic data persistence interval(minute)
#Ignorance means no persistence
#flow_store_interval=1

# log level LevelEmergency->0  LevelAlert->1 LevelCritical->2 LevelError->3 LevelWarning->4 LevelNotice->5 LevelInformational->6 LevelDebug->7
log_level=7
#log_path=nps.log

#Whether to restrict IP access, true or false or ignore
#ip_limit=true

#p2p
#p2p_ip=127.0.0.1
#p2p_port=6000

#web
#面板host
web_host=127.0.0.1
#面板账号
web_username=nmy
#面板密码
web_password=nmy
#面板启动端口号
web_port = 8888
web_ip=0.0.0.0
web_base_url=
#是否开启https默认不开启
web_open_ssl=false
web_cert_file=conf/server.pem
web_key_file=conf/server.key
# if web under proxy use sub path. like http://host/nps need this.
#web_base_url=/nps

#Web API unauthenticated IP address(the len of auth_crypt_key must be 16)
#Remove comments if needed
#auth_key=test
auth_crypt_key =1234567812345678

#allow_ports=9001-9009,10001,11000-12000

#Web management multi-user login
allow_user_login=false
allow_user_register=false
allow_user_change_username=false


#extension
allow_flow_limit=false
allow_rate_limit=false
allow_tunnel_num_limit=false
allow_local_proxy=false
allow_connection_num_limit=false
allow_multi_ip=false
system_info_display=false

#cache
http_cache=false
http_cache_length=100

#get origin ip
http_add_origin_header=false

#pprof debug options
#pprof_ip=0.0.0.0
#pprof_port=9999

#client disconnect timeout
disconnect_timeout=60

3、启动nps

./nps start

 

 

 

参考:NPS 内网穿透 - 简书 (jianshu.com)

 

- THE END -
Tag:

LG5

1月04日09:39

最后修改:2024年1月4日
0

非特殊说明,本博所有文章均为博主原创。