Saving Username/Password
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 3
- Joined: Sat Sep 22, 2012 4:50 pm
Saving Username/Password
Is there a way to save my VPN provider's username/password credentials when using OpenVPN's client instead of having to type it in each type I establish a connection to a server? Here is a config file from a randomly chosen server as it is now.
client
dev tun
proto udp
remote us-texas.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass
comp-lzo
verb 1
reneg-sec 0
client
dev tun
proto udp
remote us-texas.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass
comp-lzo
verb 1
reneg-sec 0
- maikcat
- Forum Team
- Posts: 4200
- Joined: Wed Jan 12, 2011 9:23 am
- Location: Athens,Greece
- Contact:
Re: Saving Username/Password
Michael.--auth-user-pass [up]
Authenticate with server using username/password. up is a file containing username/password on 2 lines (Note: OpenVPN will only read passwords from a file if it has been built with the --enable-password-save configure option, or on Windows by defining ENABLE_PASSWORD_SAVE in config-win32.h).
If up is omitted, username/password will be prompted from the console.
The server configuration must specify an --auth-user-pass-verify script to verify the username/password provided by the client.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
-
- OpenVpn Newbie
- Posts: 1
- Joined: Mon Sep 24, 2012 2:19 pm
Re: Saving Username/Password
As maikcat said above
try this solution
add this line to your openvpn clients config file
try this solution
add this line to your openvpn clients config file
create new file named login.conf and then add your clients username and passwordauth-user-pass login.conf
username
password
-
- OpenVpn Newbie
- Posts: 3
- Joined: Sat Sep 22, 2012 4:50 pm
Re: Saving Username/Password
Ok I'm a little confused with
Do I merely need to do what jogomedia said and define a file on the auth-user-pass line and in that file enter my username/password on two lines? Or could you clarify what the above quote from Maikcat means?or on Windows by defining ENABLE_PASSWORD_SAVE in config-win32.h).
If up is omitted, username/password will be prompted from the console.
The server configuration must specify an --auth-user-pass-verify script to verify the username/password provided by the client.
- xauen
- Forum Team
- Posts: 80
- Joined: Tue May 10, 2011 7:57 pm
- Location: Manila, Philippines
- Contact:
Re: Saving Username/Password
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:
3. Then save it.
4. open up your .ovpn file in notepad and add:
5. save and connect to your openvpn server.
2. Put your user/pass inside the file in two(2) lines, like:
Code: Select all
username
password
4. open up your .ovpn file in notepad and add:
Code: Select all
auth-user-pass pass.txt
"Never be bullied into silence. Never allow yourself to be made a victim. Accept no ones definition of you"
-IDK
-IDK
-
- OpenVpn Newbie
- Posts: 14
- Joined: Tue Aug 06, 2013 12:24 pm
Re: Saving Username/Password
how do i fix that ?Options error: --auth-user-pass fails with 'passwords.txt': No such file or dire
ctory
Options error: Please correct these errors.
Use --help for more information.
Press any key to continue...
-
- OpenVpn Newbie
- Posts: 14
- Joined: Tue Aug 06, 2013 12:24 pm
Re: Saving Username/Password
its there with the .ovpn folder.
where do i need to put it ?
where do i need to put it ?
- maikcat
- Forum Team
- Posts: 4200
- Joined: Wed Jan 12, 2011 9:23 am
- Location: Athens,Greece
- Contact:
Re: Saving Username/Password
you can use absolute path name as well...
Michael.
Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
Long live Dino Dini (Kick off 2 Creator)
Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)
"objects in mirror are losing"
-
- OpenVpn Newbie
- Posts: 14
- Joined: Tue Aug 06, 2013 12:24 pm
Re: Saving Username/Password
ty, works only in full path. could be a windows os problem :/
-
- OpenVpn Newbie
- Posts: 3
- Joined: Fri Nov 15, 2013 9:14 am
Re: Saving Username/Password
Good morning,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:
3. Then save it.Code: Select all
username password
4. open up your .ovpn file in notepad and add:
5. save and connect to your openvpn server.Code: Select all
auth-user-pass pass.txt
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
-
- OpenVpn Newbie
- Posts: 16
- Joined: Tue Jul 23, 2013 1:16 pm
Re: Saving Username/Password
- Open your txt-file in notepad++
- Edit->EOL Conversion->Convert to Unixformat
- Save txt-file
- Try again
Does it help?
Mathias
- Edit->EOL Conversion->Convert to Unixformat
- Save txt-file
- Try again
Does it help?
Mathias
-
- OpenVpn Newbie
- Posts: 3
- Joined: Fri Nov 15, 2013 9:14 am
Re: Saving Username/Password
To be sure, username is the common name asked during creation of certificat?
Because when i don't use the option auth-user-pass, i don't need to put a username to connect (only the password..)
Because when i don't use the option auth-user-pass, i don't need to put a username to connect (only the password..)
-
- OpenVpn Newbie
- Posts: 3
- Joined: Fri Nov 15, 2013 9:14 am
Re: Saving Username/Password
Unfortunately no, for information the encoding format is UTF-8MatVPN wrote:- Open your txt-file in notepad++
- Edit->EOL Conversion->Convert to Unixformat
- Save txt-file
- Try again
Does it help?
Mathias
-
- OpenVpn Newbie
- Posts: 1
- Joined: Thu Dec 05, 2013 6:56 am
Re: Saving Username/Password
This worked for me. Note that you have to use double back slashes and quotes. My user/pw file was named login.txt:
client
dev tun
proto udp
remote ca-toronto.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass "c:\\program files\\openvpn\\config\\login.txt"
comp-lzo
verb 1
reneg-sec 0
client
dev tun
proto udp
remote ca-toronto.privateinternetaccess.com 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
tls-client
remote-cert-tls server
auth-user-pass "c:\\program files\\openvpn\\config\\login.txt"
comp-lzo
verb 1
reneg-sec 0
-
- OpenVpn Newbie
- Posts: 2
- Joined: Sun Apr 27, 2014 9:40 pm
Re: Saving Username/Password
I tried all these tips, with and without the full path, and then including the double "\\". That line in the .ovpn file now reads:
auth-user-pass "C:\\Program Files\\OpenVPN\\config\\login.conf"
OpenVPN still prompts me for a user and pass. Help!
auth-user-pass "C:\\Program Files\\OpenVPN\\config\\login.conf"
OpenVPN still prompts me for a user and pass. Help!
-
- OpenVpn Newbie
- Posts: 2
- Joined: Sun Apr 27, 2014 9:40 pm
Re: Saving Username/Password
The log includes:
The config file does include a certificate and a key. It works fine after I enter the user and pass when prompted.Sun Apr 27 17:43:45 2014 MANAGEMENT: >STATE:1398635025,GET_CONFIG,,,
Sun Apr 27 17:43:46 2014 SENT CONTROL [OpenVPN Server]: 'PUSH_REQUEST' (status=1)
Sun Apr 27 17:43:46 2014 AUTH: Received control message: AUTH_FAILED
Sun Apr 27 17:43:46 2014 SIGUSR1[soft,auth-failure] received, process restarting
Sun Apr 27 17:43:46 2014 MANAGEMENT: >STATE:1398635026,RECONNECTING,auth-failure,,
-
- OpenVpn Newbie
- Posts: 2
- Joined: Wed Aug 27, 2014 4:16 am
Re: Saving Username/Password
This is interesting, but I'm not sure I understand.Kyrax wrote:To be sure, username is the common name asked during creation of certificat?
Because when i don't use the option auth-user-pass, i don't need to put a username to connect (only the password..)
I don't want to store the password in plaintext on my machine, however, I'd like to skip the username prompt. Are you saying there is some way I could accomplish that?
-
- OpenVpn Newbie
- Posts: 1
- Joined: Wed Sep 17, 2014 3:46 pm
Re: Saving Username/Password
I do as this:
client
dev tun
proto udp
; Cert
ns-cert-type server
cipher BF-CBC
;Host
resolv-retry infinite
;auth
auth-user-pass "C:\\Program\\OpenVPN\\config\\selogin.txt"
remote xxxxxxxxxxxxx
persist-key
persist-tun
nobind
comp-lzo
verb 2
<ca>
-----BEGIN CERTIFICATE-----
xxxx
-----END CERTIFICATE-----
</ca>
From client window:
Wed Sep 17 17:53:41 2014 OpenVPN 2.1_rc20 i686-pc-mingw32 [SSL] [LZO2] built on Nov 3 2009
Wed Sep 17 17:53:41 2014 Sorry, 'Auth' password cannot be read from a file
Wed Sep 17 17:53:41 2014 Exiting
OS WINXP 32 bit,
Something missing?
client
dev tun
proto udp
; Cert
ns-cert-type server
cipher BF-CBC
;Host
resolv-retry infinite
;auth
auth-user-pass "C:\\Program\\OpenVPN\\config\\selogin.txt"
remote xxxxxxxxxxxxx
persist-key
persist-tun
nobind
comp-lzo
verb 2
<ca>
-----BEGIN CERTIFICATE-----
xxxx
-----END CERTIFICATE-----
</ca>
From client window:
Wed Sep 17 17:53:41 2014 OpenVPN 2.1_rc20 i686-pc-mingw32 [SSL] [LZO2] built on Nov 3 2009
Wed Sep 17 17:53:41 2014 Sorry, 'Auth' password cannot be read from a file
Wed Sep 17 17:53:41 2014 Exiting
OS WINXP 32 bit,
Something missing?
- maikcat
- Forum Team
- Posts: 4200
- Joined: Wed Jan 12, 2011 9:23 am
- Location: Athens,Greece
- Contact:
Re: Saving Username/Password
that quite old...OpenVPN 2.1_rc20
download and use the latest version
Michael.
-
- OpenVpn Newbie
- Posts: 1
- Joined: Thu Oct 23, 2014 8:44 am
Re: Saving Username/Password
I neither have to enter a username, and I found a line
so I uncommented and created a file "tunnel.pass" in the config-directory with one line of my PW.
Works fine for me (on Win7, OpenVPN 2.3.4.0)
Code: Select all
# askpass tunnel.pass
Works fine for me (on Win7, OpenVPN 2.3.4.0)