選擇Linux系統版本
獲取安裝包 :https://www.shenzhuohl.com/download.html
這里以Ubuntu 18.04為例,其它版本方法類似
登錄Ubuntu操作系統:
-
打開Ubuntu系統終端,更新版本
apt-get update
安裝運行環境:
-
安裝C++ 運行環境 切換到root 權限安裝運行環境
sudo su
apt-get install g++
如果是Centos系統,輸入以下命令進行系統初始化(其它步驟和Ubuntu一致)
yum install gcc gcc-c++ wget -y
下載和安裝神卓互聯內網穿透客戶端:
mkdir /usr/local/shenzhuo
cd /usr/local/shenzhuo
下載完成后執行以下命令進行解壓
tar -xf shenzhuo.tar
解壓成功后得到兩個文件,分別為client和libprotobuf.so.28,(運行時請確保libprotobuf.so.28這個依賴文件和client在同一個目錄下)
給運行權限賦值
chmod +x client
注冊系統服務和開機自啟動
編寫腳本
vi /etc/systemd/system/shenzhuo.service
[Unit]
Description=shenzhuohulian Service
After=network.target
[Service]
Type=simple
WorkingDirectory=/usr/local/shenzhuo
ExecStart=/usr/local/shenzhuo/client 18800000000 123456
ExecStop=/bin/kill -2
Restart=always
StartLimitBurst=0
[Install]
WantedBy=multi-user.target
-
使配置文件生效
chmod +x /etc/systemd/system/shenzhuo.service
systemctl daemon-reload
systemctl restart shenzhuo
systemctl enable shenzhuo
systemctl enable shenzhuo
到此,Linux版已安裝完成,如您在控制臺創建或者修改了映射通道后,需要重啟服務生效,即
systemctl restart shenzhuo