Je@nb a écrit :
Non mais adaptable par contre il l'est, ou tu peux en faire un qui colle à ton besoin
|
Dans la doc d'openvpn (http://openvpn.net/index.php/open-source/documentation/manuals/65-openvpn-20x-manpage.html)
je me rends compte qu'on peut avoir accès à un certain nombre de variables (dont common-name et username) en scriptant et en utilisant l'attribut "auth-user-pass-verify" :
Environmental Variables Once set, a variable is persisted indefinitely until it is reset by a new value or a restart, As of OpenVPN 2.0-beta12, in server mode, environmental variables set by OpenVPN are scoped according to the client objects they are associated with, so there should not be any issues with scripts having access to stale, previously set variables which refer to different client instances. bytes_received Total number of bytes received from client during VPN session. Set prior to execution of the --client-disconnect script. bytes_sent Total number of bytes sent to client during VPN session. Set prior to execution of the --client-disconnect script. common_name The X509 common name of an authenticated client. Set prior to execution of --client-connect, --client-disconnect, and --auth-user-pass-verify scripts. config Name of first --config file. Set on program initiation and reset on SIGHUP. .. username The username provided by a connecting client. Set prior to --auth-user-pass-verify script execution only when the via-env modifier is specified.
|
sais-tu si je peux utiliser le plugin pam qui marche très bien... et faire, en plus, un script de vérification avec "auth-user-pass-verify" ?
mon server.conf serait du genre :
... common-name-as-username plugin /usr/share/openvpn/plugin/lib/openvpn-auth-pam.so openvpn auth-user-pass-verify mon-script-bash-de-verif.sh via-env
|
a priori je ne pense pas....( que ce soit possible d'utiliser le plugin + auth-user-pass-verify)
mais je ne souhaite pas mettre un script-security level à 3 et n'utiliser que auth-user-pass-verify...
--script-security level [method] This directive offers policy-level control over OpenVPN’s usage of external programs and scripts. Lower level values are more restrictive, higher values are more permissive. Settings for level: 0 -- Strictly no calling of external programs. 1 -- (Default) Only call built-in executables such as ifconfig, ip, route, or netsh. 2 -- Allow calling of built-in executables and user-defined scripts. 3 -- Allow passwords to be passed to scripts via environmental variables (potentially unsafe).
|
Message édité par arn100 le 13-05-2012 à 21:46:03