How to securely connect to openvpn?
From the openvpn docs:
Running the OpenVPN client with the downloaded client config file:
Usually, the easiest way to install an OpenVPN client is to use the --config argument to specify the location of the downloaded client config file:
openvpn --config client.ovpn
You can use the
--daemon option to run openvpn on background as a daemon according to the openvpn manpages:
Become a daemon after all initialization functions are completed. This option will cause all message and error output to be sent to the syslog file (such as /var/log/messages), except for the output of scripts and ifconfig commands, which will go to /dev/null unless otherwise redirected. The syslog redirection occurs immediately at the point that --daemon is parsed on the command line even though the daemonization point occurs later. If one of the --log options is present, it will supercede syslog redirection.
openvpn --config client.ovpn --daemon
How to securely disconnect openvpn?
According to the man page and the official docs openvpn accept
openvn to exit securely.
Causes OpenVPN to exit gracefully.