How to save password for automatic OpenVPN authentication on Windows & Mac OS X and Linux?

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 where 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 (x86)\OpenVPN\config
    • Linux - /etc/openvpn
    • Mac (Tunnelblick) - ~/Library/Application Support/Tunnelblick/Configurations

               Go to your OpenVPN or Tunnelblick config
                If you have a subfolder within the config folder where your configuration files/certs reside, make sure to dive down to that folder.

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. 

                Input your login and pass inside the auth.txt
Now open your OpenVPN/Tunnelblick config file, which should be in the same folder, in a text editor (if on Windows use Notepad++ instead of Notepad). 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. 
                specify the auth.txt on the .ovpn file

3. Try to connect to OpenVPN or Tunnelblick. You may need to restart the OpenVPN/Tunnelblick client and you should now connect without a username and password prompt!

Was this answer helpful?

 Print this Article

Also Read

ManyVPN address servers locations with OpenVPN profile .OVPN

Locations FR-DE Seoul-KR JP1-HK HK1-CN HK2-Asia LO-EU LD-US-EU NY-US...

New way to connect to our VPN, issues and solutions for VPN Network Connection

  How to Flush DNS? VPN connected but No Internet Access If you are using Apple Devices...

Setting up your VPN under Android

Before proceeding, please check which VPN type (PPTP or L2TP/IPSec) is suitable for your...

Setting up ManyVPN Certificate on Microsoft Windows

I-)ManyVPN Certificate Installation on Microsoft Windows 7First, download the ManyVPN Windows...

Setting up your SSH Tunnel Socks Proxy under Windows and Mac OSX

1) Download Myentunnel, SwitchyOmega and install Chrome browser Download MyEnTunnel here for...