On Wed, 02 Feb 2022 16:16:05 +0100, Bo Berglund <bo.bergl...@gmail.com> wrote:
>On Wed, 2 Feb 2022 13:02:15 +0000, Emanuel Gonzalez ><emanuel_gonza...@live.com.ar> wrote: > >>Hi everyone >> >>Im trying to start a VPN connection through a shell script but I cant run >>it in background, Ive tried with: >> >>sudo openvpn --config "/home/user/config.ovpn" & >>sudo openvpn --config "/home/user/config.ovpn" >/dev/null 2>&1 >> >I belive you can do thia if you are on Linux and are using the latest openvpn: > >Put the config.ovpn file in /etc/openvpn/client, then it will connect in the >background once you enable the new service. > >sudo systemctl enable openvpn-client@config >sudo systemctl start openvpn-client@config >sudo systemctl stop openvpn-client@config >sudo systemctl disable openvpn-client@config > >(You might want to name the file something other than "config" so you know to >where it connects when used. Forgot to say: -------------- 1) The config.ovpn file must be renamed to config.conf since the service scans the client directory for *.conf files 2) The config file needs to *not* be password protected because I do not know how one can set up a decryption password for an ovpn file and pass it to systemd. I am using this connection system on a RaspberryPi device and it works very well, but I created a specific client ovpn file *without* the client password for it. The connection is protected by the certificates anyway. -- Bo Berglund Developer in Sweden _______________________________________________ Openvpn-users mailing list Openvpn-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-users