I have a server with OpenVPN installed on it, and I also have laptops (clients) running Ubuntu with openvpn installed. On the client, if I manually run the command "sudo openvpn /etc/openvpn/client.conf" the client is configured to prompt me for login info (username and password) which it will then use in authentication with the server. I would like this process to happen automatically on startup. Basically, I need logging into the client laptop and logging into the openvpn server to be the same action. I want the the authentication information for logging into openvpn to be the same as the login information for logging into the laptop's local user account. How can I do this?? Details please.
Use "auth-user-pass credentials-file.txt" option in your client config file. The credentials file should be in the form:
Yes, you will have the plaintext file with username and password.
I assume You have downloaded
.ovpn file with information about vpn.
Create next to it, a file,
auth.txt and insert in first line vpn login, in second line vpn password.
Save file and close it. Edit Your
.ovpn file, find line starting with
auth-user-pass and add
auth.txt. Save file and close it.
!! However I would write with full path to
Now You should be able call
sudo openvpn <.ovpn file> without providing credentials.
There is a small note how to autorun scripts on system boot: here