You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
704 B

# is a client-connect script for OpenVPN server
# When connecting using the PAM plugin, it allow clients to connect only if their CN is equal to their UNIX username
# You need this parameters in your's server config :
# script-security 2
# client-connect <path-to-cn-filter>/
set -u
if [ "${common_name}" = "${username}" ]; then
logger -i -t openvpn-cn-validation -p "Accepted login for ${common_name} from ${trusted_ip} port ${trusted_port}"
exit 0
logger -i -t openvpn-cn-validation -p auth.notice "Failed login for CN ${common_name} / username ${username} from ${trusted_ip} port ${trusted_port}"
exit 1