使用Pritunl构建企业远程接入系统
|Word Count:486|Reading Time:1mins|Post Views:
pritunl是一个开源的企业级分布式远程接入服务器。它的社区版就是单机版,开源、免费,同时支持图形化的管理界面。它在高级版中可以通过RADIUS服务支持Openldap或者Active Directory的用户管理,只不过需要每个月70$的授权费用。

部署
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| # 系统环境为AlmaLinux 8.8 # 系统需要关闭selinux,以下使用root账户进行安装 tee /etc/yum.repos.d/mongodb-org-6.0.repo << EOF [mongodb-org-6.0] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/6.0/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc EOF
tee /etc/yum.repos.d/pritunl.repo << EOF [pritunl] name=Pritunl Repository baseurl=http://repo.pritunl.com/stable/yum/almalinux/8/ gpgcheck=1 enabled=1 EOF
# 安装EPEL包 dnf install -y epel-release dnf update -y
# 安装Wireguard支持 dnf install -y wireguard-tools # 移除防火墙 dnf remove -y iptables-services systemctl stop firewalld.service systemctl disable firewalld.service
# 在线导入证书 gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A gpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp; sudo rpm --import key.tmp; rm -f key.tmp # 离线配置软件源的gpg证书 # rpm --import https://raw.githubusercontent.com/pritunl/pgp/master/pritunl_repo_pub.asc
# 从pritunl的repo源中安装openvpn dnf --allowerasing install -y pritunl-openvpn dnf install -y pritunl mongodb-org systemctl enable mongod pritunl systemctl start mongod
#初始化密钥 pritunl setup-key
# 获取到安装key之后,再启动服务pritunl ritunl set app.redirect_server false systemctl stop pritunl systemctl start pritunl
# 查看80端口程序和443端口程序是否已经打开 netstat -tlnp # 访问https://localIP/ 使用上面获得的setup-key来进行下一步安装,登陆界面会给出获取登陆账号和密码的方式 pritunl default-password
|
面板
服务端
添加用户(需要先添加组织)

添加服务器(服务器需要附加到组织中去)

下载用户配置文件

服务器日志

客户端
pritunl有丰富的客户端支持,也可以直接使用openvpn的客户端

安装客户端之后导入用户配置文件

使用pin码连接

完成连接
