Ubuntu 22.04 安装 SoftEther VPN 指南

Ubuntu 22.04 源码编译安装 SoftEther VPN 全实录:稳定版 4.44(configure/make,systemd 托管)与开发版 5.02.5187(CMake)双方案、初始化三步、六条真实排障与卸载清理。

SoftEther VPNVPN网络配置安全2026/10/20

Ubuntu 22.04 安装 SoftEther VPN 指南

目标:在 Ubuntu 22.04 上从零安装 SoftEther VPN Server 并用 systemd 托管,覆盖稳定版 4.44(build 9807)源码编译主线与开发版 5.02.5187 源码编译备用线两条路径,含安装、初始化、验证、常见故障与卸载全流程。本文所有命令与回显均在 Ubuntu 22.04 实机逐条执行并实录,版本取证日期 2026-10-20。

一、环境信息

本文实测环境(以下命令与回显均在此环境采集):

  • 操作系统:Ubuntu 22.04(LTS,内核 5.15 系列,x86_64,12 vCPU)
  • 软件版本:SoftEther VPN 稳定版 4.44(build 9807,RTM,源码构建日期 2025-04-16);开发版 5.02(build 5187)
  • 编译工具链:gcc 11.4.0 / GNU Make 4.3 / OpenSSL 3.0.2 / CMake 3.22.1(开发版方案使用)
  • 安装布局:稳定版方案安装到 /usr/vpnserver/(配置文件 /usr/vpnserver/vpn_server.config)、/usr/vpnclient/、/usr/vpnbridge/、/usr/vpncmd/,命令入口 /usr/bin/vpncmd
  • 监听端口:默认 TCP 443、992、1194、5555(可增删,见常见问题 8.3)
  • systemd:systemd 249(Ubuntu 22.04 自带),服务名 softether-vpnserver

二、前置条件

2.1 硬件与系统要求

SoftEther 官方定位为 1Gbps 级吞吐、低内存占用的用户态实现(README 原文 "1Gbps-class high-speed throughput performance with low memory and CPU usage")。实测最小可用配置:

  • CPU:1 核即可运行,多核利于并发会话(实测编译用 12 核并行 make -j12 大幅提速)
  • 内存:进程常驻约 24 MB(实测 systemctl status 回显 Memory: 24.2M),256 MB 以上内存即可
  • 磁盘:源码包约 25 MB,解压后约 130 MB,编译中间产物约 200 MB,建议预留 1 GB
  • 网络:编译时需访问 GitHub 下载源码包

2.2 编译依赖

稳定版 4.44 使用自带 configure 脚本 + make 构建,需安装以下包(一次安装,全部来自 Ubuntu 22.04 官方源):

apt-get update
apt-get install -y build-essential libreadline-dev libssl-dev libncurses-dev zlib1g-dev wget ca-certificates

说明:build-essential 提供 gcc/g++/make;libssl-dev 提供 OpenSSL 开发头文件(实测链接 OpenSSL 3.0.2);libreadline-dev、libncurses-dev 为 vpncmd 交互行编辑所需;zlib1g-dev 为压缩支持。

开发版 5.x 额外需要 CMake 与 libsodium(官方 src/BUILD_UNIX.md 的 Debian/Ubuntu 清单):

apt-get install -y cmake gcc g++ make pkgconf libncurses5-dev libssl-dev libsodium-dev libreadline-dev zlib1g-dev git

2.3 防火墙端口规划

按默认监听面放行 TCP 443、992、1194、5555(ufw allow 443/tcp 等);若 443 已被 Web 服务器占用,见常见问题 8.3 的换端口方案。

三、版本选型说明

SoftEther 官方维护双仓库双版本线(取证日期 2026-10-20,GitHub release tag 实查):

版本线仓库最新版本(tag 实查)特点适用
稳定版(Stable Edition)SoftEtherVPN/SoftEtherVPN_Stable4.44 build 9807(tag v4.44-9807-rtm,源码 CurrentBuild.txt 标注构建日期 2025-04-16)协议全(SSL-VPN/OpenVPN/IPsec/L2TP/MS-SSTP/L2TPv3/EtherIP),质量稳定,兼容 SoftEther 1.0 客户端生产部署首选
开发版(Developer Edition)SoftEtherVPN/SoftEtherVPN5.02 build 5187(tag 5.02.5187)额外支持 WireGuard 协议、AEAD OpenVPN、默认 AES-NI、TLS 标准校验、JSON-RPC API尝鲜/需要 WireGuard

关键差异:官方 README 明确写有 "Stable Edition is available on https://github.com/SoftEtherVPN/SoftEtherVPN_Stable which the non-developer user can stable use",即官方推荐普通用户使用稳定版仓库;开发版协议矩阵更多但按官方对照表存在部分特性差异(如证书认证范围、IPv6 隧道范围,详见《SoftEther VPN 4.44 介绍与选型指南》第四章)。本文主线选稳定版 4.44,开发版 5.02.5187 作为方案 B 完整实测。

两版均无官方 deb/rpm 包,Ubuntu 22.04 官方源亦未收录 SoftEther,源码编译是两条版本线的共同安装主线;官方另提供 Windows/macOS 二进制安装包下载站 softether-download.com,Linux 端以源码构建为准。

四、方案 A:稳定版 4.44 源码编译安装(主线)

本章为完整 0→1 主线:依赖 → 下载 → 编译 → 安装 → systemd 托管 → 验证,每步命令与回显均为实机实录。

4.1 下载源码包

cd /root
wget https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/archive/refs/tags/v4.44-9807-rtm.tar.gz -O softether-v4.44-9807-rtm.tar.gz

实测输出(节选):

--2026-10-20 11:49:26--  https://github.com/SoftEtherVPN/SoftEtherVPN_Stable/archive/refs/tags/v4.44-9807-rtm.tar.gz
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: 'softether-v4.44-9807-rtm.tar.gz'
softether-v4.44-9807-rtm.tar.gz         [        <=>                         ]  25.74M  12.6MB/s    in 2.1s

校验包完整性并确认大小:

ls -la softether-v4.44-9807-rtm.tar.gz
sha256sum softether-v4.44-9807-rtm.tar.gz

实测输出:

-rw-r--r-- 1 root root 25738681 Oct 20 11:49 softether-v4.44-9807-rtm.tar.gz
8ccd8959a674bd4b34f9fc5dd9eb60fe0226b0adc0f6f852a07011dcc769ed97  softether-v4.44-9807-rtm.tar.gz

4.2 解压并配置

tar xzf softether-v4.44-9807-rtm.tar.gz
cd SoftEtherVPN_Stable-4.44-9807-rtm
./configure

实测输出(完整尾部):

---------------------------------------------------------------------
SoftEther VPN for Unix

Copyright (c) Daiyuu Nobori.
Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
Copyright (c) SoftEther Corporation.
Copyright (c) all contributors on SoftEther VPN in GitHub.

License: The Apache License, Version 2.0

Read and understand README.TXT, LICENSE.TXT and WARNING.TXT before use.
---------------------------------------------------------------------

Welcome to the corner-cutting configure script !

The Makefile is generated. Run 'make' to build SoftEther VPN.

💡 说明:稳定版的 configure 是"corner-cutting"(走捷径式)脚本,不做交互提问、不探测依赖——依赖缺失会在 make 阶段才报错,因此 2.2 节的依赖务必先装齐。

4.3 编译与安装

make -j$(nproc)

实测输出(尾部节选,编译产物为四个二进制):

cc tmp/as/vpnbridge.a -O2 -fsigned-char -m64 -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o bin/vpnbridge/vpnbridge
cc tmp/as/vpnserver.a -O2 -fsigned-char -m64 -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o bin/vpnserver/vpnserver
cc tmp/as/vpncmd.a -O2 -fsigned-char -m64 -lm -ldl -lrt -lpthread -lssl -lcrypto -lreadline -lncurses -lz -o bin/vpncmd/vpncmd

12 核并行编译约 6 分钟完成。安装:

make install

实测输出(尾部节选):

cp bin/vpncmd/vpncmd /usr/vpncmd/vpncmd
echo "#!/bin/sh" > /usr/bin/vpncmd
echo /usr/vpncmd/vpncmd '"$@"' >> /usr/bin/vpncmd
echo 'exit $?' >> /usr/bin/vpncmd
chmod 755 /usr/bin/vpncmd

--------------------------------------------------------------------
Installation completed successfully.

Execute 'vpnserver start' to run the SoftEther VPN Server background service.
Execute 'vpnbridge start' to run the SoftEther VPN Bridge background service.
Execute 'vpnclient start' to run the SoftEther VPN Client background service.
Execute 'vpncmd' to run SoftEther VPN Command-Line Utility to configure VPN Server, VPN Bridge or VPN Client.
--------------------------------------------------------------------

确认安装布局:

ls /usr/vpnserver/
which vpncmd

实测输出:

hamcore.se2
vpnserver
/usr/bin/vpncmd

💡 说明:/usr/vpnserver/ 中的 hamcore.se2 是打包资源库(运行必需);vpnserver 是服务主程序。首次启动后该目录会生成 vpn_server.config(配置文件)与 server_log/、security_log/、packet_log/ 三个日志目录。make install 同时安装了 vpnserver/vpnclient/vpnbridge/vpncmd 四个组件,本文只启用 vpnserver。

4.4 systemd 托管

稳定版源码仓库自带参考单元 systemd/softether-vpnserver.service(面向官方二进制布局 /opt/vpnserver),源码安装到 /usr/vpnserver 时需将路径适配为本机实际布局。创建单元文件:

cat > /etc/systemd/system/softether-vpnserver.service <<'EOF'
[Unit]
Description=SoftEther VPN Server
After=network.target auditd.service

[Service]
Type=forking
ExecStart=/usr/vpnserver/vpnserver start
ExecStop=/usr/vpnserver/vpnserver stop
KillMode=process
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF

要点说明:vpnserver start 会 fork 出常驻进程后返回(实测主进程形如 /usr/vpnserver/vpnserver execsvc),故 Type=forking;KillMode=process 与官方单元保持一致,仅杀主进程组。

加载并设置开机自启、启动:

systemctl daemon-reload
systemctl enable softether-vpnserver
systemctl start softether-vpnserver

实测输出:

Created symlink /etc/systemd/system/multi-user.target.wants/softether-vpnserver.service → /etc/systemd/system/softether-vpnserver.service.

4.5 安装验证

确认服务状态:

systemctl is-active softether-vpnserver
systemctl status softether-vpnserver --no-pager

实测输出:

active
● softether-vpnserver.service - SoftEther VPN Server
     Loaded: loaded (/etc/systemd/system/softether-vpnserver.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2026-10-20 11:51:56 UTC; 3s ago
    Process: 4052 ExecStart=/usr/vpnserver/vpnserver start (code=exited, status=0/SUCCESS)
   Main PID: 4056 (vpnserver)
      Tasks: 32 (limit: 5753)
     Memory: 24.2M
        CPU: 293ms
     CGroup: /system.slice/.../system.slice/softether-vpnserver.service
             ├─4056 /usr/vpnserver/vpnserver execsvc
             └─4057 /usr/vpnserver/vpnserver execsvc

确认监听端口:

ss -ltnp | grep vpnserver

实测输出:

LISTEN 0      4096         0.0.0.0:992        0.0.0.0:*    users:(("vpnserver",pid=4057,fd=25))
LISTEN 0      4096         0.0.0.0:443        0.0.0.0:*    users:(("vpnserver",pid=4057,fd=21))
LISTEN 0      4096         0.0.0.0:1194       0.0.0.0:*    users:(("vpnserver",pid=4057,fd=29))
LISTEN 0      4096         0.0.0.0:5555       0.0.0.0:*    users:(("vpnserver",pid=4057,fd=33))
LISTEN 0      4096            [::]:992           [::]:*    users:(("vpnserver",pid=4057,fd=27))
LISTEN 0      4096            [::]:443           [::]:*    users:(("vpnserver",pid=4057,fd=22))
LISTEN 0      4096            [::]:1194          [::]:*    users:(("vpnserver",pid=4057,fd=31))
LISTEN 0      4096            [::]:5555          [::]:*    users:(("vpnserver",pid=4057,fd=35))

确认管理口可用(vpncmd 连接本地服务器,首次连接尚无管理密码,直接回车即可获得管理员权限):

vpncmd 127.0.0.1:5555 /SERVER /CMD ServerStatusGet

实测输出(节选):

Connection has been established with VPN Server "127.0.0.1" (port 5555).

You have administrator privileges for the entire VPN Server.

ServerStatusGet command - Get Current Server Status
Item                                          |Value
----------------------------------------------+-------------------------
Server Type                                   |Standalone Server
Number of Virtual Hubs                        |1
Number of Sessions                            |0
Server Started at                             |2026-10-20 (Tue) 11:51:56
The command completed successfully.

4.6 初始化管理员密码(装后必做)

首次连接无需密码即可获得管理员权限,装完必须立刻设置管理密码(本文示例统一使用测试口令 q1w2e3r4):

printf "q1w2e3r4\nq1w2e3r4\n" | vpncmd 127.0.0.1:5555 /SERVER /CMD ServerPasswordSet

实测输出:

Password: ********
Confirm input: ********


The command completed successfully.

设置后所有管理连接必须带 /PASSWORD: 参数:

vpncmd 127.0.0.1:5555 /SERVER /PASSWORD:q1w2e3r4 /CMD ServerStatusGet

五、方案 B:开发版 5.02 源码编译安装(CMake)

开发版 5.x 改用 CMake 构建体系且依赖 git 子模块,流程与稳定版差异较大,本章同样全流程实测(版本 5.02 build 5187)。

5.1 克隆仓库并拉取子模块

⚠️ 重要:开发版不能用 GitHub 网页下载的 tar.gz 源码包直接构建——tar 包不含 git 子模块,configure 会报错(真实报错与解决办法见 8.5)。必须用 git 克隆并初始化子模块(官方 src/BUILD_UNIX.md 原文流程:"git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git → git submodule init && git submodule update")。

apt-get install -y git
cd /root
git clone https://github.com/SoftEtherVPN/SoftEtherVPN.git
cd SoftEtherVPN
git submodule update --init --recursive

子模块清单(官方 .gitmodules 实读):src/libhamcore(hamcore 构建工具)、3rdparty/tinydir、3rdparty/BLAKE2、src/Mayaqua/3rdparty/cpu_features,以及 OpenSSL 3.0+ 环境启用的后量子密码库 src/Mayaqua/3rdparty/liboqs 与 oqs-provider(源码 src/Mayaqua/CMakeLists.txt 逻辑:OpenSSL ≥ 3.0 且 < 4.0 时 OQS_ENABLE ON)。

5.2 配置、编译与安装

./configure

实测输出(尾部):

-- Build files have been written to: /root/SoftEtherVPN/build

The Makefile is generated. Run 'make -C build' to build SoftEther VPN.

编译与安装(注意必须 -C build,直接 make 会报 "No targets specified and no makefile found"——实测踩坑):

make -C build -j$(nproc)
make -C build install

实测输出(尾部节选):

Execute 'vpnclient start' to run the SoftEther VPN Client background service.
Execute 'vpncmd' to run the SoftEther VPN Command-Line Utility to configure VPN Server, VPN Bridge or VPN Client.

5.3 安装布局与 systemd

开发版安装布局与稳定版不同(实测确认):

which vpnserver vpncmd

实测输出:

/usr/local/bin/vpnserver
/usr/local/bin/vpncmd

二进制在 /usr/local/bin/,程序目录为 /usr/local/libexec/softether/vpnserver/;且 make install 自带官方 systemd 单元(/usr/lib/systemd/system/softether-vpnserver.service,Type=exec 直启 vpnserver execsvc,含 PrivateTmp/ProtectSystem 等加固项),无需手写:

systemctl daemon-reload
systemctl enable --now softether-vpnserver
systemctl is-active softether-vpnserver

实测输出:

Created symlink /etc/systemd/system/multi-user.target.wants/softether-vpnserver.service → /lib/systemd/system/softether-vpnserver.service.
active

版本验证(vpncmd 横幅标注 Developer Edition):

vpncmd 127.0.0.1:443 /SERVER /CMD About

实测输出(节选):

vpncmd command - SoftEther VPN Command Line Management Utility Developer Edition
SoftEther VPN Command Line Management Utility (vpncmd command)
Developer Edition
Version 5.02 Build 5187 (English)
Compiled 2026/10/20 12:17:47 by  at se-client
Copyright (c) all contributors on SoftEther VPN project in GitHub.

默认监听端口与稳定版一致(实测 ss -ltnp 可见 vpnserver 持有 443/992/1194/5555)。

六、方案对比与选择建议

维度方案 A:稳定版源码编译方案 B:开发版源码编译
版本4.44 build 9807(2025-04-16)5.02 build 5187(master 线)
构建体系自带 configure + makeCMake + git 子模块
额外依赖gcc/make/openssl/readline/ncurses方案 A 全部 + cmake/libsodium/git
源码获取tag tar.gz 直下(25.7 MB,sha256 实录)必须 git clone + submodule(tar 包缺子模块不可构建)
安装布局/usr/vpnserver、/usr/bin/vpncmd/usr/local/bin、/usr/local/libexec/softether
systemd 单元需按布局自写(官方参考单元为 /opt/vpnserver 布局)make install 自带(Type=exec + 加固项)
协议面七协议(无 WireGuard)七协议 + WireGuard、AEAD OpenVPN
升级方式下载新 tag 重编译,配置文件/证书/日志目录保留即原位升级git pull + submodule update + 重编译
建议生产环境需要 WireGuard 协议或 JSON-RPC API 时

选择建议:能联网编译的生产服务器直接选方案 A——版本冻结、官方推荐、流程最少;确需 WireGuard 协议接入(官方对照表标注仅开发版支持)再选方案 B,并接受 master 线演进节奏。两方案不可混装:安装前确认没有残留的对方布局(见九、卸载与清理)。

七、配置说明

7.1 最小可用配置(装后三步)

以稳定版为例如下(开发版命令相同,仅 vpncmd 连接端口同为 443/5555)。第一步设管理密码(4.6 节);第二步在默认虚拟 Hub DEFAULT 建用户:

printf "q1w2e3r4\nq1w2e3r4\n" | vpncmd 127.0.0.1:5555 /SERVER /PASSWORD:q1w2e3r4 /ADMINHUB:DEFAULT /CMD UserCreate admin /GROUP:none /REALNAME:admin /NOTE:demo

实测输出:

The Virtual Hub "DEFAULT" has been selected.
UserCreate command - Create User
The command completed successfully.

⚠️ 注意:UserCreate 交互式提示输入并确认密码,管道输入两行口令即可;若创建后未设密码,客户端认证会失败(真实故障案例见 8.1)。

第三步开启 SecureNAT(虚拟 DHCP + NAT,让客户端拨入即拿地址):

vpncmd 127.0.0.1:5555 /SERVER /PASSWORD:q1w2e3r4 /ADMINHUB:DEFAULT /CMD SecureNatEnable

实测输出:

SecureNatEnable command - Enable the Virtual NAT and DHCP Server Function (SecureNat Function)
The command completed successfully.

7.2 配置文件位置与持久化

  • 稳定版:/usr/vpnserver/vpn_server.config;开发版:/usr/local/libexec/softether/vpnserver/vpn_server.config
  • 服务运行期间会自动回写(实测默认每 300 秒,AutoSaveConfigSpan),人工编辑前必须先停服务,否则改动被覆盖(配置文件头部注释原文:"You may edit this file when the VPN Server / Client / Bridge program is not running... Otherwise, all changes will be lost.")
  • 日常增删改一律走 vpncmd 命令(实时生效并持久化),配置文件仅作备份审读;逐项参数含义见《SoftEther VPN 4.44 配置参数详解》。

7.3 日志目录

目录内容示例(实测文件名)
/usr/vpnserver/server_log/服务器级日志(vpn_日期.log)vpn_20261020.log
/usr/vpnserver/security_log/<Hub名>/安全日志(登录/用户操作,sec_日期.log)sec_20261020.log
/usr/vpnserver/packet_log/<Hub名>/包日志(pkt_日期.log,默认仅记录 TCP 连接头)pkt_20261020.log

八、常见问题(FAQ)

8.1 客户端拨入报 "User authentication failed. (code 9)"

现象:客户端会话状态 Retrying,客户端日志记录 Cause: User authentication failed. (code 9)(实测实录)。

原因与解决:UserCreate 创建了用户但密码未设置成功。重设用户密码后重连即可:

printf "q1w2e3r4\nq1w2e3r4\n" | vpncmd 127.0.0.1:5555 /SERVER /PASSWORD:q1w2e3r4 /ADMINHUB:DEFAULT /CMD UserPasswordSet admin

实测重连后客户端 AccountStatusGet 回显 Session Status | Connection Completed (Session Established)。

8.2 IPsecEnable 报 "/L2TP_Raw 不是有效参数"

现象(实测回显):

The parameter "/L2TP_Raw" has been specified. It is not possible to specify this parameter when using the command "IPsecEnable".

原因与解决:该命令的原始 L2TP 参数名是 /L2TPRAW(无下划线)。执行 vpncmd ... /CMD IPsecEnable /HELP 查看真实用法:IPsecEnable [/L2TP:yes|no] [/L2TPRAW:yes|no] [/ETHERIP:yes|no] [/PSK:pre-shared-key] [/DEFAULTHUB:default_hub]。改用正确参数后执行成功(实测 IPsecGet 回显 L2TP over IPsec Server Function Enabled | Yes)。

8.3 TCP 443 被其他服务占用导致监听失败

现象:ListenerList 显示 TCP 443 | Error,其余端口正常(实测用另一进程占用 443 后复现):

Port Number|Status
-----------+---------
TCP 443    |Error
TCP 992    |Listening
TCP 1194   |Listening
TCP 5555   |Listening

解决:释放 443,或给 SoftEther 换/加监听端口。增删监听端口命令(实测):

vpncmd 127.0.0.1:5555 /SERVER /PASSWORD:q1w2e3r4 /CMD ListenerCreate 8151
vpncmd 127.0.0.1:5555 /SERVER /PASSWORD:q1w2e3r4 /CMD ListenerList
vpncmd 127.0.0.1:5555 /SERVER /PASSWORD:q1w2e3r4 /CMD ListenerDelete 8151

实测 ListenerList 回显新端口 TCP 8151 | Listening;删除后恢复四端口默认形态。客户端连接地址相应改为 服务器IP:8151。

8.4 ServerCertGet 导出证书失败(参数形态问题)

现象(实测回显):ServerCertGet /usr/vpnserver/server.crt 报 The parameter "/usr/vpnserver/server.crt" has been specified...,且目标路径无文件。

原因与解决:该命令的导出路径是位置参数而非 / 开头的选项参数,且相对路径按执行 vpncmd 时的当前目录落盘。正确写法:

cd /root
vpncmd 127.0.0.1:5555 /SERVER /PASSWORD:q1w2e3r4 /CMD ServerCertGet server.crt
openssl x509 -in /root/server.crt -noout -subject -dates

实测 openssl 验证回显:

subject=CN = se-server, O = se-server, OU = se-server, C = US
notBefore=Oct 20 11:51:56 2026 GMT
notAfter=Dec 31 11:51:56 2037 GMT

8.5 开发版 tar 包构建报 "does not contain a CMakeLists.txt file"

现象(实测回显,节选):用 GitHub 网页 tar.gz 构建 5.02 时:

CMake Error at src/Mayaqua/CMakeLists.txt:29 (add_subdirectory):
  does not contain a CMakeLists.txt file.
-- Configuring incomplete, errors occurred!

原因与解决:tar 包不含 git 子模块(src/libhamcore、liboqs 等,官方 .gitmodules 实读清单)。改走 5.1 节 git clone + git submodule update --init --recursive 流程后 configure 通过(实测 Build files have been written to: .../build)。

8.6 本地桥接 TAP 状态显示 Error

现象:BridgeCreate DEFAULT /DEVICE:se-tap /TAP:yes 后 BridgeList 显示 Status | Error。

原因与解决:TAP 设备未被拉起(内核已创建 tap_se-tap 但未 UP)。执行 ip link set tap_se-tap up 后复查,实测 BridgeList 回显 1 | DEFAULT | se-tap | Operating。另注意本地桥接到物理网卡时提示需在虚拟化平台开启网卡的混杂模式(实测命令回显含该提示原文)。

九、卸载与清理

停止并撤销开机自启(每条仅针对一个单元):

systemctl stop softether-vpnserver
systemctl disable softether-vpnserver

按安装布局删除文件。方案 A(稳定版布局):

rm -rf /usr/vpnserver /usr/vpnclient /usr/vpnbridge /usr/vpncmd /usr/bin/vpncmd
rm -f /etc/systemd/system/softether-vpnserver.service
systemctl daemon-reload

方案 B(开发版布局):

systemctl stop softether-vpnserver
systemctl disable softether-vpnserver
rm -rf /usr/local/libexec/softether /usr/local/bin/vpnserver /usr/local/bin/vpnclient /usr/local/bin/vpnbridge /usr/local/bin/vpncmd
rm -f /usr/lib/systemd/system/softether-vpnserver.service /usr/lib/systemd/system/softether-vpnclient.service /usr/lib/systemd/system/softether-vpnbridge.service
systemctl daemon-reload

卸载前如需备份配置与证书:

mkdir -p /root/se-backup
cp -a /usr/vpnserver/vpn_server.config /root/se-backup/
cp -a /usr/vpnserver/chain_certs /root/se-backup/ 2>/dev/null

清理源码目录与编译产物:

rm -rf /root/SoftEtherVPN_Stable-4.44-9807-rtm /root/softether-v4.44-9807-rtm.tar.gz

编译依赖(build-essential 等)是否卸载按主机策略自定,一般保留。

十、参考链接

  1. 稳定版源码仓库:https://github.com/SoftEtherVPN/SoftEtherVPN_Stable(tag v4.44-9807-rtm)
  2. 开发版源码仓库与官方构建文档:https://github.com/SoftEtherVPN/SoftEtherVPN(src/BUILD_UNIX.md)
  3. 官方二进制下载站:https://www.softether-download.com/
  4. 官方 systemd 参考单元:稳定版仓库 systemd/softether-vpnserver.service
  5. 姊妹篇:《SoftEther VPN 4.44 介绍与选型指南》《SoftEther VPN 4.44 配置参数详解》《SoftEther VPN 4.44 常用 CLI 命令详解》