Save Username and Password in OpenVPN for Automatic login

in

Tips & Tricks

By default, OpenVPN will save username and password and you can login automatically if you don’t press the login button in 5 seconds. However, in the old versions, this feature was not available and you need to do some manual steps as described below in the old days.

 

Save Username and Password in OpenVPN for Automatic login (Outdated Method)

The following steps are out of date and you don’t need to do any of them to save username and password on OpenVPN anymore.

By default, OpenVPN does not save the username and password which requires you to input them in each time you connect to the server. This is good from a security perspective, but there are sometimes when it is required to have this information saved to permit automatic logins to OpenVPN.

If you need to save the username and password to a VPN connection, follow the steps below.

1-Navigate to your config folder for OpenVPN. Some common paths for this folder are:

  • Windows – C:\Program Files\OpenVPN\config
  • Mac (Tunnelblick) – ~/Library/Application Support/Tunnelblick/Configurations

openvpn automatic login

2-Create a new text file in this folder. We’ll name ours “auth.txt”. The contents of this text file should simply be two lines. The first line should be your username, and the second should be your password. Save this file.

Important Note: If you get Permission Denied Error, Create the file on your desktop and then copy and paste it into that directory.

openvpn save password

openvpn save password

3-Now open your OpenVPN config file(SaturnVPN_OVPN_DE.ovpn , SaturnVPN_OVPN_US.ovpn ,SaturnVPN_OVPN_UK.ovpn Or SaturnVPN_OVPN_CA.ovpn)which is in the same folder, in a text editor . These files typically end in a .ovpn extension. Find the line that says “auth-user-pass” and change it to “auth-user-pass auth.txt”, where “auth.txt” is the name of the file containing your username and password. Save this file.

Important Note: If you get Permission Denied Error, Copy the file and paste it to your desktop, Modify it, save it, copy it, and paste it to that directory.

openvpn save password

step4

4-Try to connect to OpenVPN. You may need to restart the OpenVPN client and you should now connect without a username and password prompt!

Menu