OpenVPN - make Client Specific Overrides persistent after reboot
-
Hello,
we want to generate OpenVPN Client Specific Overrides with a script and not with the GUI for each user individually. Therefore we created files like:
/var/etc/openvpn/serverX/csc/unsernameTo make them persistent, so that they are not deleted after reboot, we used:
chflags schg /var/etc/openvpn/serverX/csc/*But this caused the pfSense to stop booting and complaining that the folder and files in
/var/etc/openvpn/
could not be deleted.Is there a way to create OpenVPN Client Specific Overrides with a script and make them persistent after reboot?
we use currently 25.11.1
Greetings, Nina Kuckländer
-
@eegclbugs said in OpenVPN - make Client Specific Overrides persistent after reboot:
with a script and not with the GUI for each user individually.
You're already close to the answer ^^
If you found this :

you actually use this :

That file can be found here : /usr/local/www/vpn_openvpn_csc.php
Read that file (it's a script, world's most known : php)
The bottom part is what your browser shows you.
The top part is where the user's input (the pfSense admin), is validated, stored in the "one and unique pfSense config file" and you also find where the scs file are created etc.
So ... if your script can use this script as a source, model (etc) you'll have the best of both worlds :
Your script adds/edit/whateber the scs file.
The - your - info is stored into the "one and unique pfSense config file" so when pfSense restarts, everything is setup according to its "one and unique pfSense config file" info.
And you can still use the GUI to look/edit/delete things.Btw : this is a 'how I would do it solution'.
Commanding pfSense from the command line without doing it the 'pfSense' way is generally a bad idea.