和其它的文章不同,以下是很简单的搭建方法
1、升级系统打上补丁可以使用以下命令行
sudo apt update
sudo apt upgrade -y
2、下载openvpn的安装脚本,使用脚本安装省去安装证书等过程。我们可以通过以下命令下载脚本并运行脚本
wget https://git.io/vpn -O openvpn-ubuntu-install.sh
chmod -v +x openvpn-ubuntu-install.sh
sudo ./openvpn-ubuntu-install.sh
在安装过程选择如下图:
主要选项是协议一般选择UDP,DNS可以任意选择,Client名称可以自己名字,运行完脚本最终会在 /root目录下生成一个 .ovpn文件,这个正是我们上网的凭证文件。同时vpn服务也会自动安装好了
3、我们可以通过以下命令来管理vpn服务
sudo systemctl status openvpn-server@server.service
sudo systemctl start openvpn-server@server.service
sudo systemctl stop openvpn-server@server.service
sudo systemctl restart openvpn-server@server.service
4、如果我们还要添加用户可以继续运行以下脚本
sudo ./openvpn-ubuntu-install.sh
端口测试
nc -vuz 159.135.192.235 1194
// Connection to 159.135.192.235 1194 port [udp/openvpn] succeeded!
https://gist.github.com/ebta/301f286fa9056d67e61bfc7cedd4ad56
相关链接:
https://linuxconfig.org/basic-ubuntu-22-04-openvpn-client-server-connection-setup
https://kifarunix.com/install-and-setup-openvpn-server-on-ubuntu-22-04/
https://www.cyberciti.biz/faq/ubuntu-20-04-lts-set-up-openvpn-server-in-5-minutes/
版权属于:区块链中文技术社区 / 转载原创者
本文链接:https://www.bcskill.com/index.php/archives/2442.html
相关技术文章仅限于相关区块链底层技术研究,禁止用于非法用途,后果自负!本站严格遵守一切相关法律政策!
还不快抢沙发