Saving Username/Password

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

freedomClub
OpenVpn Newbie
Posts: 2
Joined: Thu Oct 29, 2015 7:22 am

Re: Saving Username/Password

Post by freedomClub » Thu Oct 29, 2015 7:25 am

On windows the password file (eg. "login.conf") needs to be in:
1. DOS file format
2. Not UTF-8

freedomClub
OpenVpn Newbie
Posts: 2
Joined: Thu Oct 29, 2015 7:22 am

Re: Saving Username/Password

Post by freedomClub » Thu Oct 29, 2015 7:28 am

In windows the passwords file (eg. login.conf) needs to be:
1. DOS file format
2. Not UTF-8

thelimey
OpenVpn Newbie
Posts: 1
Joined: Thu Aug 08, 2013 3:13 pm

Re: Saving Username/Password

Post by thelimey » Tue Feb 16, 2016 6:52 pm

LOL. I had this issue, and eventually worked out it was because I was an idiot....

I forgot that:
1) Windows hides file extensions
2) notepad adds .txt to the file name

So OpenVPN was correct that the file login.conf didn't exist because it was actually named login.conf.txt

I tried with Notepad++ after others said that was the way they got it to work. It saves the file with the name you specify, without adding an extra .txt, that was when I realised what had happened.

joutcast
OpenVpn Newbie
Posts: 2
Joined: Fri Dec 09, 2016 10:32 pm

Re: Saving Username/Password

Post by joutcast » Fri Dec 09, 2016 10:43 pm

Not attempting to be captain obvious here, and please correct me if this is not getting over looked. However, I have not seen anyone specifying to insert the file name at the header of the file.... the only way it works for me is outlined below. This example assumes login.conf is the credentialing file and in the same directory.

In YourConnection.ovpn on auth-usr-pass line:

auth-usr-pass "./login.conf"

In your login.conf file:

login.conf
YourUserName
YourPassword

joutcast
OpenVpn Newbie
Posts: 2
Joined: Fri Dec 09, 2016 10:32 pm

Re: Saving Username/Password

Post by joutcast » Fri Dec 09, 2016 11:27 pm

Sorry it is "auth-user-pass" lol

User avatar
disqualified
OpenVPN User
Posts: 40
Joined: Fri Jun 03, 2016 7:13 pm

Re: Saving Username/Password

Post by disqualified » Fri Dec 09, 2016 11:30 pm

joutcast wrote:auth-us(e)r-pass "./login.conf"
Do not name your file login.conf :roll:

minions
OpenVpn Newbie
Posts: 4
Joined: Wed Jul 26, 2017 12:03 am

Re: Saving Username/Password

Post by minions » Wed Jul 26, 2017 12:07 am

I found the answer!

I know this is pretty dang old but I figure there are some out there like me who came across this while trying to find the answer.

I also found this: https://community.openvpn.net/openvpn/ticket/697

Which gave me the answer. If you notice, it is a ticket and the answer is given by OpenVPN staff themselves, so that should instill confidence. In any case, it worked for me while no other post listed in this thread worked.

What you need to do is add this to your *.ovpn file:

Code: Select all

askpass "C:/Program Files/OpenVPN/config/[filename].conf"
Then create that .conf file with ONLY your password.

It should work! Sorry if it doesn't! I'm just passing on what worked for me and what I believe works.

Good luck!

msoldier55
OpenVpn Newbie
Posts: 1
Joined: Thu Oct 26, 2017 1:24 am

Re: Saving Username/Password

Post by msoldier55 » Thu Oct 26, 2017 1:25 am

This solution works. However, what if the VPN requires a group. I am using a Windows environment.

When I use Cisco AnyConnect, I specify a group, username and password. What is the equivalent in the config file?

Thanks.

Max

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Saving Username/Password

Post by TinCanTech » Thu Oct 26, 2017 10:20 am

msoldier55 wrote:
Thu Oct 26, 2017 1:25 am
what if the VPN requires a group
Openvpn only supports username and password.

Sumku
OpenVpn Newbie
Posts: 1
Joined: Sun Sep 27, 2020 6:41 am

Re: Saving Username/Password

Post by Sumku » Sun Sep 27, 2020 6:43 am

joutcast wrote:
Fri Dec 09, 2016 10:43 pm
Not attempting to be captain obvious here, and please correct me if this is not getting over looked. However, I have not seen anyone specifying to insert the file name at the header of the file.... the only way it works for me is outlined below. This example assumes login.conf is the credentialing file and in the same directory.

In YourConnection.ovpn on auth-usr-pass line:

auth-usr-pass "./login.conf"

In your login.conf file:

login.conf
YourUserName
YourPassword
You know, I had searched at so many places and tried so many different things that when your suggestion finally worked, I just could not resist the urge to create Profile just so that I can say "Thank You". Solved for Me. Greatly Appreciated.

anatakwala
OpenVpn Newbie
Posts: 1
Joined: Thu Jan 07, 2021 8:55 pm

Re: Saving Username/Password

Post by anatakwala » Thu Jan 07, 2021 9:03 pm

auth-usr-pass "./login.conf"

This did not help in connecting OpenVpn Connect 2.6.0.100 on a Windows 10 machine.

auth-user-pass "C:\\Users\\ab\\Downloads\\login.conf"

Any suggestions on how to fix it?

dukeofurl
OpenVpn Newbie
Posts: 3
Joined: Thu Aug 27, 2020 4:02 am

Re: Saving Username/Password

Post by dukeofurl » Tue Jun 28, 2022 1:15 am

I'm trying to figure this out now, June 27th 2022. I'm not having good luck.

On mine, the .exe is called OpenVPNConnect.exe and there is no config directory next to it. The exact path is "C:\Program Files\OpenVPN Connect"
is Connect something else, a completely different program?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Saving Username/Password

Post by TinCanTech » Tue Jun 28, 2022 9:17 am

dukeofurl wrote:
Tue Jun 28, 2022 1:15 am
On mine, the .exe is called OpenVPNConnect.exe
OpenVPN-Connect-Windows is not the same as OpenVPN.

dukeofurl
OpenVpn Newbie
Posts: 3
Joined: Thu Aug 27, 2020 4:02 am

Re: Saving Username/Password

Post by dukeofurl » Wed Jun 29, 2022 4:35 am

Please, tell me what I must do then. Is there a special client I have to download? I just want a vpn to my isp that saves my username/pw. I have a ovpn file from my ISP.

glestwid
OpenVpn Newbie
Posts: 2
Joined: Thu Jun 18, 2020 9:55 am

Re: Saving Username/Password

Post by glestwid » Mon Jul 11, 2022 7:28 pm

Hi,

Is it possible to save user &pwd combination directly in the distributed .OVPN file? For example , my Keenetic router supports this tag in passed .OVPN files:

<auth-user-pass>
user
pwd
</auth-user-pass>

The target OpenVPN client is OpenVPN Connect 2.7.1.111, OS - Windows 10 x64 21H2

simon1974smith@gmail.com
OpenVpn Newbie
Posts: 1
Joined: Tue Apr 18, 2023 11:42 am

Re: Saving Username/Password

Post by simon1974smith@gmail.com » Tue Apr 18, 2023 11:45 am

Kyrax wrote:
Fri Nov 15, 2013 9:20 am
xauen wrote:1. Create a txt file on a folder alongside your .ovpn files name it what ever you want ex. 'pass.txt'
2. Put your user/pass inside the file in two(2) lines, like:

Code: Select all

username
password
3. Then save it.
4. open up your .ovpn file in notepad and add:

Code: Select all

auth-user-pass pass.txt
5. save and connect to your openvpn server.
Good morning,

i tried this but the password continue to be asked. it look like the second line isn't read. (the file pass.txt was created with notepad++)
No error messages appear in logs.

Version 2.3.2
OS: Win 7 64 bits

Thanks for your help
I got the same issue as I added a new line for auth-user-pass at the end of the .ovpn file. But there was a pre-existing auth-user-pass without any filename higher up in the .ovpn file, which cause the issue. Try add your password file with the full path to the pre-existing auth-user-pass line and leave it with that.

emoxam
OpenVpn Newbie
Posts: 8
Joined: Fri Jun 09, 2023 12:27 pm

Re: Saving Username/Password

Post by emoxam » Tue Jan 16, 2024 7:43 am

Yep.
askpass tunnel.pass
and no login in tunnel.pass
only password.
thanks!

Post Reply