下载并解压NPS
下载NPS
最新版本可以在NPS框架查找
wget https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_server.tar.gz
解压NPS
解压后所有的数据都在当前文件夹下,我们要修改提前/opt/conf/下的原始配置文件,找到#web这一行修改用户名密码即可
tar -zxvf linux_amd64_server.tar.gz
安装并运行NPS
安装NPS
安装为系统服务
sudo ./nps install
systemd
我们需要把nps运行在后台并方便查看日志所以我们需要注册为systemd服务,其中用户名必须是你自己的用户名,一般我们用这种方式安装nps的路径是在/opt/nps下,安装后得到配置文件也在这个文件夹下
cat > /etc/systemd/system/nps.service << 'EOF'
[Unit]
Description=nps server
After=network.target
[Service]
Type=simple
ExecStart=/opt/nps
WorkingDirectory=/opt
Restart=always
User=root
StandardOutput=journal
StandardError=journal
[Install]
WantedBy=multi-user.target
EOF
运行NPS
重新加载 + 启动
systemctl daemon-reload
systemctl restart nps
其他命令
systemctl status nps //查看状态
journalctl -u nps -f //查看日志
安装客户端(NPC)
下载 npc
最好保持版本一致
wget https://github.com/ehang-io/nps/releases/download/v0.26.10/linux_amd64_client.tar.gz
tar -zxvf linux_amd64_client.tar.gz //解压
设置为后台服务
期间终端可能会断连一次 其中service和-vkey 是在nps服务端获取到的
sudo ./npc install -server=1.2.3.4:8024 -vkey=xxxx
sudo npc start
至此 nps的服务端和客户端安装都已经完成