OpenVPN 访问服务器创建组和用户

OpenVPN 访问服务器创建组和用户

我已经通过 cloudformations 在 aws 上创建了一个 OpenVPN - 除了引导之外,一切工作正常。

在用户数据上我输入了一些命令来做一些更改,例如启用 googleauth 等。

除此之外,我还想创建一个组 - 然后创建用户并分配给该组,完成这些之后,我想为该组创建一个角色,以便它进行拆分隧道传输,例如并非所有流量都通过互联网 - 所以我只想将几个 IP 重定向到该组

我目前正在通过创建组进行堆栈 - 我找到了命令https://evanhoffman.com/2014/07/22/openvpn-cli-cheat-sheet/并在引导程序中输入,但我找不到任何用于创建组以创建允许访问网络服务的访问控制的内容。

那么有人有使用 openvpn 访问服务器 CLI 的经验吗?如何创建组并将用户分配到该组以进行拆分隧道?

答案1

我也遇到过这样的情况,我想通过 googleauth 脚本创建一个组。我找到了这篇文章:https://forums.openvpn.net/viewtopic.php?t=21680#p61381

我扩展了所提供的解决方案,并在此处提供解释:https://forums.openvpn.net/viewtopic.php?t=21680#p72243

快速参考:

cd /usr/local/openvpn_as/scripts

# Create the group named "googleauth" using sacli
./sacli --user googleauth --key type --value group UserPropPut

# Configure the group properties to require google_auth
./confdba --userdb --prof googleauth --mod --key c2s_dest_s --value false
./confdba --userdb --prof googleauth --mod --key c2s_dest_v --value false
./confdba --userdb --prof googleauth --mod --key group_declare --value true
./confdba --userdb --prof googleauth --mod --key prop_autologin --value false
./confdba --userdb --prof googleauth --mod --key prop_deny --value false
./confdba --userdb --prof googleauth --mod --key prop_google_auth --value true
./confdba --userdb --prof googleauth --mod --key prop_superuser --value false
./confdba --userdb --prof googleauth --mod --key type --value group

# Reload config with sacli
./sacli start

答案2

./sacli --用户团队名字--key prop_reroute_gw_override --值选项用户属性置入

价值选择

dns_only:将其路由到他们的网关,但是 DNS 查找必须通过 VPN 服务器。

全球的:遵循默认组合

     1) vpn.client.routing.reroute_gw 
     2) vpn.client.routing.reroute_dns 

禁用:请勿覆盖。

相关内容