Save username only and prompt for password

How to customize and extend your OpenVPN installation.
Locked
marcolino7
OpenVpn Newbie
Posts: 2
Joined: Wed Nov 28, 2012 11:01 pm

Save username only and prompt for password

Post by marcolino7 » Wed Nov 28, 2012 11:04 pm

Hi,
i just seached into forum and over google but i found no solution.
In my config file i have auth-user-pass parameter and client prompt me for user and password.
I would like to save ONLY the username and promped for password each time i connect.
It's is possible? I', running openvpn2.2.2 on windows 7 32 bit.

Thanks

marcolino7
OpenVpn Newbie
Posts: 2
Joined: Wed Nov 28, 2012 11:01 pm

Re: Save username only and prompt for password

Post by marcolino7 » Tue Dec 04, 2012 4:19 pm

Up.............

CourtK
OpenVpn Newbie
Posts: 4
Joined: Wed Feb 13, 2013 10:51 pm

Re: Save username only and prompt for password

Post by CourtK » Tue Apr 16, 2013 7:53 pm

Bump. I am interested in this too. Is there a way to do this?

User avatar
janjust
Forum Team
Posts: 2702
Joined: Fri Aug 20, 2010 2:57 pm
Location: Amsterdam
Contact:

Re: Save username only and prompt for password

Post by janjust » Wed Apr 17, 2013 8:19 am

currently there is no way to do this in openvpn 2.2 or 2.3; the patch is fairly trivial, I guess, but nobody has bothered to write it thus far.

stefan2k1
OpenVpn Newbie
Posts: 1
Joined: Tue Sep 22, 2015 12:57 pm

Re: Save username only and prompt for password

Post by stefan2k1 » Tue Sep 22, 2015 12:58 pm

Hi,

is there any news here? I would like to save only the username and not the password. Has this function been implemented now?

Thanks
Stefan

dishcandanty
OpenVpn Newbie
Posts: 1
Joined: Tue Jan 19, 2016 9:15 pm

Re: Save username only and prompt for password

Post by dishcandanty » Tue Jan 19, 2016 9:18 pm

Pretty sure for the linux client (openvpn file.opvn). You can put this in the file:

Code: Select all

auth-user-pass file.txt
And said file has just a single line (you may want relative paths):

Code: Select all

name
And it will prompt for just the password.

rseiler
OpenVPN User
Posts: 33
Joined: Sat Feb 09, 2013 9:10 pm

Re: Save username only and prompt for password

Post by rseiler » Sun Aug 21, 2016 1:53 am

Re the last poster, does that definitely work with the Linux client? It doesn't work with the Windows client.

If you just have the single line, it'll come back right away with an error ("Connecting to [username] has failed."). If you create a newline after it, it does the same. Perhaps there's some other nuance to this.

The manual seems to agree with you though. Could it be in reference to Linux only?
--auth-user-pass [up]

Authenticate with server using username/password. up is a file containing username/password on 2 lines. If the password line is missing, OpenVPN will prompt for one.

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 2992
Joined: Fri Jun 03, 2016 1:17 pm

Re: Save username only and prompt for password

Post by TinCanTech » Sun Aug 21, 2016 2:52 pm

At this time under windows, using username only in the file does not work.

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 2992
Joined: Fri Jun 03, 2016 1:17 pm

Re: Save username only and prompt for password

Post by TinCanTech » Mon Aug 22, 2016 12:09 pm

A more detailed explanation can be found here:
https://sourceforge.net/p/openvpn/mailm ... /35293066/

rseiler
OpenVPN User
Posts: 33
Joined: Sat Feb 09, 2013 9:10 pm

Re: Save username only and prompt for password

Post by rseiler » Mon Aug 22, 2016 3:11 pm

>We could easily make querying from management get higher priority over
>reading from file/console, but, given that the latest GUI remembers
>username, there may not be a strong need for such a feature.

Has anyone seen it do that on Windows?

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 2992
Joined: Fri Jun 03, 2016 1:17 pm

Re: Save username only and prompt for password

Post by TinCanTech » Mon Aug 22, 2016 3:29 pm

If you mean:
rseiler wrote:given that the latest GUI remembers
>username
You need the latest development snapshot not the 2.3.11 release.

See here:
http://build.openvpn.net/downloads/snapshots/

rseiler
OpenVPN User
Posts: 33
Joined: Sat Feb 09, 2013 9:10 pm

Re: Save username only and prompt for password

Post by rseiler » Wed Aug 24, 2016 7:57 pm

TinCanTech wrote:If you mean:
rseiler wrote:given that the latest GUI remembers
>username
You need the latest development snapshot not the 2.3.11 release.

See here:
http://build.openvpn.net/downloads/snapshots/
I haven't been following how those pre-releases work, but the latest one there seems to still be a 2.3.11 (but a later version of it). Today, 2.3.12 was released publicly, so if version numbers mean anything, then I would think it would have it. I haven't been able to test yet.

szeestraten
OpenVpn Newbie
Posts: 1
Joined: Wed Nov 02, 2016 1:04 pm

Re: Save username only and prompt for password

Post by szeestraten » Wed Nov 02, 2016 1:08 pm

Is the Windows client for 2.3.12 supposed to be able to remember only the username?
If so, how?

rseiler
OpenVPN User
Posts: 33
Joined: Sat Feb 09, 2013 9:10 pm

Re: Save username only and prompt for password

Post by rseiler » Tue Nov 29, 2016 2:06 am

I don't know. Even the 2.3.13 client doesn't do it here. Username is never remembered.

TiTex
OpenVPN Expert
Posts: 231
Joined: Tue Apr 12, 2011 6:22 am

Re: Save username only and prompt for password

Post by TiTex » Tue Nov 29, 2016 7:41 am

the beta 2.4 does , and i didn't have any issues with it regarding to connect to remote servers.

rseiler
OpenVPN User
Posts: 33
Joined: Sat Feb 09, 2013 9:10 pm

Re: Save username only and prompt for password

Post by rseiler » Fri Dec 02, 2016 9:25 pm

What's the trick? I just tried it with the newly-posted 2.4 RC1, which I see in the release notes has "Support for username-only auth file," but when I removed the PW from my file and tried making a connection, I got the usual immediate "Connection has failed" (same as what I get with 2.3). The log reads "Failed retrieving username or password."

Somewhere a while back I read that the end of the auth file needs to have a blank line, but that didn't work either.

rseiler
OpenVPN User
Posts: 33
Joined: Sat Feb 09, 2013 9:10 pm

Re: Save username only and prompt for password

Post by rseiler » Sat Dec 17, 2016 7:12 pm

RC2 is out now. No change.

@TiTex, still waiting on you to clear up specifically how it's done.

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 2992
Joined: Fri Jun 03, 2016 1:17 pm

Re: Save username only and prompt for password

Post by TinCanTech » Sat Dec 17, 2016 9:34 pm

rseiler wrote:RC2 is out now. No change
It works as expected ..

--auth-user-pass useronly.txt
useronly.txt
username

rseiler
OpenVPN User
Posts: 33
Joined: Sat Feb 09, 2013 9:10 pm

Re: Save username only and prompt for password

Post by rseiler » Sat Dec 17, 2016 9:46 pm

There's some other variable, because that's how I've been trying it. It quickly comes back with the error I mentioned a couple message ago.

User avatar
TinCanTech
OpenVPN Protagonist
Posts: 2992
Joined: Fri Jun 03, 2016 1:17 pm

Re: Save username only and prompt for password

Post by TinCanTech » Sat Dec 17, 2016 11:23 pm

rseiler wrote:There's some other variable, because that's how I've been trying it
There is some other variable because it works fine if done correctly.
rseiler wrote:It quickly comes back with the error I mentioned a couple message ago.
rseiler wrote:I got the usual immediate "Connection has failed" (same as what I get with 2.3). The log reads "Failed retrieving username or password."
Sure ..

Please read this:
HOWTO: Request Help !

Then start a detailed thread in the appropriate place, thanks.

Locked