Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

openvpn freeware login password

25 views
Skip to first unread message

Scott Lurndal

unread,
Sep 4, 2021, 11:37:12 PM9/4/21
to
[1]If you go to https://www.freeopenvpn.org/index.php
[2]You can download a free openvpn configuration file
[3]Which asks for a login/password (which they give you)

Doing this as admin puts you on free vpn all day with no limits (AFAIK).
C:\Program Files\OpenVPN\bin\openvpn.exe USA_freeopenvpn_udp.ovpn

When you run that command, it only asks for the login/password.

How can we put the login/password into the text config batch file
so that this command works but without asking for the login/password?

Here is a current US openvpn config file (they may change over time).
https://www.freeopenvpn.org/premium.php?cntid=USA&lang=en

This is the UDP version of that text free vpn config file.
https://www.freeopenvpn.org/ovpn/USA_freeopenvpn_udp.ovpn

The username is always the same it seems: Username: freeopenvpn
The password changes daily but is currently: 009054723

What's the batch file syntax to feed it the login & password?

JJ

unread,
Sep 5, 2021, 2:42:44 AM9/5/21
to

Scott Lurndal

unread,
Sep 5, 2021, 10:49:08 AM9/5/21
to
JJ writes:
JJ <jj4p...@gmail.com> asked
> See the "Import a profile" section below (long URL warning).
>
> <https://openvpn.net/vpn-server-resources/command-line-functionality-for-openvpn-connect/#import-a-profile>

Thanks for that "import-a-profile" option where I was expecting either
a. A way for a Windows batch file to feed the login/passwd to the command
b. Or a way to add the login/passwd to the downloaded text config file
c. Or a command line option to feed the login/passwd to the command

Before I asked, I was trying to "batch the password" in an admin window:
%comspec% -k c:\Program Files\openvpn\bin\openvpn.exe
c:\pathto\USA_freeopenvpn_udp.ovpn
&& echo "freeopenvpn"
&& echo "009054723"
But I couldn't get the batch command syntax to feed the login/passwd.

I wasn't sure what a "profile" even is, so I assumed it was the
downloaded text freeopenvpn_USA_freeopenvpn_udp.ovpn config file.

I tried every syntax variation I could of that "--import-profile" option.
But all failed with syntax errors on the USA configuration text file at:
https://www.freeopenvpn.org/premium.php?cntid=USA&lang=en

Here's just one example of the many attempts that failed due to syntax.

Note the password changes daily so it's 518663582 instead of 009054723
(but everything else is the same as it was yesterday).

This always results in a syntax error (this is one long line):
c:\Program Files\openvpn\bin\openvpn.exe
--import-profile=c:\pathto\freeopenvpn_USA_freeopenvpn_udp.ovpn
--name=foo
--username=freeopenvpn
--password=518663582

But what ended up working was to create a new text file of any name
in the current directory (the dir containing the original config file):
freeopenvpn.txt
And then putting these two lines _exactly_ into that new text file:
username freeopenvpn
password 518663582
And then _changing_ this one line in the original text config file:
auth-user-pass
To point to that new text file containing the login & daily password:
auth-user-pass freeopenvpn.txt

Then when I ran the original command, everything worked just fine.
c:\Program Files\openvpn\bin\openvpn.exe USA_freeopenvpn_udp.ovpn

There's probably a more efficient way to run free open vpn,
(given the password changes daily) but this is good enough for now.

The expectation is that I can check for the new password every day and just
edit the original downloaded text config file to replace yesterday's
password with today's password.

Thanks. If you know of a more efficient way to use this free service daily,
given the password changes daily, let me know!

Nic2

unread,
Sep 5, 2021, 6:25:30 PM9/5/21
to
Scott Lurndal wrote:

> There's probably a more efficient way to run free open vpn,
> (given the password changes daily) but this is good enough for now.
>
Congratulations you now have gone beyond the browser wars and started
the vpn wars.

Scott Lurndal

unread,
Sep 12, 2021, 7:36:53 AM9/12/21
to
So that everyone always benefits, here is the latest tutorial,
with many improvements using Windows tricks.

Tutorial: *How to _efficiently_ set up free openvpn VPN on Windows 10*

Note this is not the default documented openvpn GUI installation
setup method. If you want to use the default openvpn GUI, follow
instructions at the site you obtained the OpenVPN client software.

This is how I set up openvpn to work efficiently with _many_ ovpn files.

1. Download and install a free open source Windows "openvpn" client.
This is the one I'd use: https://openvpn.net/community-downloads/
https://swupdate.openvpn.org/community/releases/OpenVPN-2.5.3-I601-amd64.msi

Note the default use model is the OpenVPN client GUI.
I use the OpenVPN client executable instead, for more direct control.

After installation, I change a few things to garner more control:
a. I change the *.ovpn file association from the GUI to the client.
b. I set permissions for OpenVPN/bin/*.exe to run as administrator.
c. I add a 32-bit registry DWORD to open more than 15 files.
d. I set OpenVPN Daemon to open logs in the same spot.
e. Optionally, I bypass the UAC nag screen (or change the sound).

A. Set the Windows 10 file association for *.ovpn to open in the daemon
Right click on any *.ovpn file in the Windows 10 File Explorer.
Select "Open with" and then "Choose another app".
Select [x] Always use this app to open *.ovpn files
Change from: *.ovpn starts with the OpenVPN GUI (openvpnserv.exe)
Change to: *.ovpn starts with the OpenVPN Daemon (openvpn.exe)

B. Set the executable permissions for OpenVPN/bin/*.exe to run as admin.
Rightclick on openvpn.exe > Properties > Compatibility >
[x]Run this program as an administrator
[Change settings for all users]
[x]Run this program as an administrator
[OK][OK]

C. Add a Windows 10 32-bit DWORD to open more than 15 files at a time.
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer
Name : MultipleInvokePromptMinimum
Type : DWORD
Default : 15 (decimal)
Change to: 200 (decimal)

D. Set OpenVPN Daemon running logs to open up in the same spot!
Doubleclick on an *.ovpn file to open up the OpenVPN Daemon log
Right click in the top bar of that running log file
Select "Properties" & go to the "Layout" tab
Position the window as you want all of the windows to appear
Uncheck the checkbox for "[ ]Let system position window"
Press OK

Be careful if that spot is a second screen as you won't be able
to see open VPN windows when/if you disconnect that second screen.

E. Optionally bypass UAC which otherwise pop up when an *ovpn is run
by adding a shortcut that calls the task scheduler which calls the
executable "with highest privileges".

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\vpnopen.exe
This allows "Win+R > vpnopen" to work.

C:\pathto\link\vpnopen.lnk
TARGET=C:\Windows\System32\schtasks.exe /run /TN "task:vpnopen"
STARTIN=%windir%\system32
COMMENT=taskschd.msc > Task Scheduler Library > task:vpnopen>
General > [x]Run with highest privileges
Actions > Start a program > Program/script > %comspec%
Add arguments > /c start "" c:\pathto\openvpn.exe c:\pathto\configs\openvpn.ovpn

Optionally, if you keep UAC, you could change the sound (if desired):
From: C:\Windows\Media\Windows User Account Control.wav
To: C:\Windows\Media\ding.wav
Control Panel -> Hardware and Sound -> Sound -> Change system sounds
Sounds -> Windows User Account Control ->
Browse -> C:\Windows\Media\ding.wav -> Test -> Apply -> OK

2. Download any number of free openvpn configuration files off the net.
You can get these free configuration files from many locations.

This is just one common free example (password changes daily):
https://www.freeopenvpn.org/
https://www.freeopenvpn.org/ovpn/USA_freeopenvpn_udp.ovpn
(other countries and protocols exist at that web site)

Here is another common free set of openvpn configuration files
(where the login/password credentials are embedded in the file):
https://vanwa.tech/vpn
https://vanwa.tech/free-openvpn-service
https://vanwa.tech/download-free-openvpn-config

And many others (many don't even require a change of login/password):
https://www.vpngate.net/en/

For our example, we'll use this particular free openvpn config file:
https://www.freeopenvpn.org/ovpn/USA_freeopenvpn_udp.ovpn

Save that file to wherever you want to store your VPN configs.
c:\pathto\configs\freeopenvpn.ovpn

3. Create a freeopenvpn.txt text file for the login & daily password.
notepad.exe freeopenvpn.txt

Each OpenVPN config file can authenticate differently.
Adjust each approach based on the specific authentication method.
For example, for freeopenvpn.org, I'd create a login/password file.

In that file I'd put the current login & password, each on a line.
freeopenvpn
173975185

Note that the freeopenvpn.org password changes frequently where
you will need to update that password file when it changes.

4. Then I'd modify the config file to find that login/password file:
C:\> notepad.exe USA_freeopenvpn_udp.ovpn

Change this line from:
auth-user-pass
Change that line to the full path to the login/password file:
auth-user-pass c:\\pathto\\configs\\freeopenvpn.txt

5. Create a batch command to run VPN for you as administrator.
notepad.exe freeopenvpn.bat

In that file you can add one line to call the desired config file.
c:\pathto\openvpn\bin\openvpn.exe c:\pathto\configs\freeopenvpn.ovpn

If desired, add paths, variables and/or a pause in case of error.

REM freeopenvpn.bat
cd c:\pathto\configs\
c:\pathto\openvpn\bin\openvpn.exe c:\pathto\configs\freeopenvpn.ovpn
pause

Or, if you want to use variables, something like this would be ok:
REM freeopenvpn.bat
REM https://www.freeopenvpn.org/premium.php?cntid=USA&lang=en
set configdir=c:\pathto\configs\
set configcmd=c:\pathto\openvpn\bin\openvpn.exe
set configfile=freeopenvpn.ovpn
cd $configdir
%configcmd% %configdir%%configfile%
pause

6. Now you can get on that free VPN by any of a few efficient methods:

I usually run it at the command line inside an administrator window:
Win+R > cmd{ctrl+shft+rtn}
C:\> .\freeopenvpn.bat

But you can also run it as admin via the Windows File Explorer.
{Rightclick on freeopenvpn.bat}{Select "Run as administrator"}

Or, in an administrator window, you can directly run the commands:
c:\pathto\openvpn\bin\openvpn.exe c:\pathto\configs\freeopenvpn.ovpn

Or, you can just doubleclick on the freeopenvpn.config file if you've
set up the "ovpn" file associations to run the openvpn client daemon
(openvpn.exe) instead of the openvpn client GUI (abc).

Note that you must run openvpn.exe as admin on Windows 10.
Otherwise it won't be able to successfully modify the routing table.

You can check the routing table before and after running the command:
route print | more

7. Doublecheck that you are on VPN if you're not sure you're connected.
Win+R > cmd{Enter}
C:\> curl icanhazip.com
That should return whatever IP address you're connected as.

You can create a command to run in the Run box if you like.
REM curlit.bat
%comspec% /k curl icanhazip.com

8. Each day you want to use VPN, check for the new password:
https://www.freeopenvpn.org/

a. Modify the password line, as needed, of the freeopenvpn.txt file.
b. Press "F4" in the resulting command window when you wish to exit.

9. The steps are similar for vanwa.tech (but even simpler):
REM vanwa.bat
REM https://vanwa.tech/download-free-openvpn-config
set configfile=vanwa.ovpn
set configcmd=c:\pathto\openvpn\bin\openvpn.exe
set configdir=c:\pathto\configs\
cd $configdir
%configcmd% %configdir%%configfile%
pause

10. Steps are similar (but with different proclivities) for vpngate.net:
REM vpngate.net
set configfile=vpngate.ovpn
set configcmd=c:\pathto\openvpn\bin\openvpn.exe
set configdir=c:\pathto\configs\
cd $configdir
%configcmd% %configdir%%configfile%
pause

In summary, there are many freely available openvpn configuration files
on the net, all of which work with the FOSS openvpn client. Each works
slightly differently though in what they require for authentication.

And that is what we're dealing with here, in addition to being
able to run any number of these files at will.

As always, please improve.
(for example if you know of other free openvpn config file repos)

Nic

unread,
Sep 12, 2021, 11:37:40 AM9/12/21
to
Thanks for a great and detailed explanation, the one question that
occurs to me is what happens when you are forced to upgrade to w11.

0 new messages