ovpn configuration file to use the credentials file: Replace username and password with your own credentials Sudo printf '%s\n' ' username' ' password' > /etc/openvpn/credentials If you want an automatic logon when you start the OpenVPN connection, you need to make the required changes to configuration files:
disown -h makes it so the process isn’t killed when the terminal is shut down. bg resumes suspended process and sends it to the background. This invokes elevation and in the same time connects to the desired VPN destination, but it does so in the foreground. Sudo openvpn -config /etc/openvpn/ US-East.ovpn Since sudo elevation that requires you to input your credentials and putting the process into the background in the same line doesn't work, this is the recommended connection method if you want to manually type in your username and password: Next, you need to connect using the current configuration file, and you'll be asked for our credentials.