I have an Ubuntu 14.04 Server with an OpenVPN Server running on it. Now for backup purposes I want this machine to create a VPN connection to a seperate machine.
I figured out that I can create a new client instance using this code:
openvpn --config openvpn.ovpn --auth-user-pass auth --auth-nocache --nobind &
where "auth" is a file containing a username and password for the connection.
This seems work fine, but the problem is that I have no idea how to close the connection after it has been opened (I do not know if this is the best solution).
I only need the connection during a backup process and it is important that the VPN server stays active, so solutions like "killall" and "restart" are not an option.
The Ubuntu Server is running without a User Interface. So I can only use command line.