host .ovpn username and password on web hosting

This is where we can discuss what we would like to see added or changed in OpenVPN.

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

Post Reply
vqoley
OpenVpn Newbie
Posts: 3
Joined: Tue Sep 13, 2022 2:34 pm

host .ovpn username and password on web hosting

Post by vqoley » Tue Sep 13, 2022 2:52 pm

Hello. is that anything command in config file that can connect username and password from hosting?

i host pass.txt in my site meaning it will like this mysite.com/pass.txt

i try use

auth-user-pass "mysite.com/pass.txt"



but i got an error:

2022-09-13 21:36:02 WARNING: cannot stat file "mysite.com/pass.txt": Unknown error (errno=123)

Options error: --auth-user-pass fails with "mysite.com/pass.txt": Unknown error (errno=123)

Options error: Please correct these errors.





anyone can help me?

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

Re: host .ovpn username and password on web hosting

Post by TinCanTech » Tue Sep 13, 2022 3:27 pm

Openvpn does not interpret such things as URLs or environment variables in the config file.

Also, why would you put your password on a website ..

vqoley
OpenVpn Newbie
Posts: 3
Joined: Tue Sep 13, 2022 2:34 pm

Re: host .ovpn username and password on web hosting

Post by vqoley » Tue Sep 13, 2022 3:31 pm

TinCanTech wrote:
Tue Sep 13, 2022 3:27 pm
Openvpn does not interpret such things as URLs or environment variables in the config file.

Also, why would you put your password on a website ..
i see that. is that anyway to put direct username and password in .ovpn without using extension file?

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

Re: host .ovpn username and password on web hosting

Post by TinCanTech » Tue Sep 13, 2022 3:37 pm

I don't understand you very well. Try searching the manual for 'pass' and 'word'.

vqoley
OpenVpn Newbie
Posts: 3
Joined: Tue Sep 13, 2022 2:34 pm

Re: host .ovpn username and password on web hosting

Post by vqoley » Tue Sep 13, 2022 3:54 pm

TinCanTech wrote:
Tue Sep 13, 2022 3:37 pm
I don't understand you very well. Try searching the manual for 'pass' and 'word'.
sorry. as you said "Openvpn does not interpret such things as URLs or environment variables in the config file.". So i don't want use .txt file to put username and password there. so i looking the other way that can enter username and password in .ovpn config file

example the one i don't want is:
auth-user-pass auth.txt

alternative i looking is like this or similar with it
auth-user-pass username:password

meaning no need link with other file.

i doing this because i build an android app. so its difficult to use local file that written with username and password. so i looking for alternative way that android app easier to access config with username and password.

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

Re: host .ovpn username and password on web hosting

Post by TinCanTech » Tue Sep 13, 2022 4:36 pm

It really makes no difference what file you use to record the username and password.

However, Openvpn only allows a standard text file for this purpose, currently.

User avatar
dazo
OpenVPN Inc.
Posts: 155
Joined: Mon Jan 11, 2010 10:14 am
Location: dazo :: #openvpn-devel @ libera.chat

Re: host .ovpn username and password on web hosting

Post by dazo » Wed Sep 14, 2022 11:52 am

The "auth.text" part is expected to be a file which the openvpn program on your machine can read. If it is in the same directory as your OpenVPN configuration file, then the file can be in the same directory. Just ensure the read privileges to this file is restricted, so other users can't read it.

Update: I was just informed this below only works with OpenVPN 3 based implementations, not OpenVPN 2.x versions.
Alternatively you can instead of using the "auth-user-pass auth.txt" in your configuration file, you can replace it with this:

Code: Select all

<auth-user-pass>
username_goes_here
password_goes_here
</auth-user-pass>

User avatar
openvpn_inc
OpenVPN Inc.
Posts: 1332
Joined: Tue Feb 16, 2021 10:41 am

Re: host .ovpn username and password on web hosting

Post by openvpn_inc » Fri Sep 16, 2022 10:37 pm

Hi vqoley,

Android users can install a text editor, or create the file somewhere else, and use some means to copy it or download it to the phone or tablet.

regards, rob0
Image OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support

User avatar
ordex
OpenVPN Inc.
Posts: 444
Joined: Wed Dec 28, 2016 2:32 am
Location: IRC #openvpn-devel @ libera.chat

Re: host .ovpn username and password on web hosting

Post by ordex » Sat Sep 17, 2022 7:46 pm

A patch to address this issue has been submitted to the mailing list. With this patch it is possible to store user and pwd inline in the .ovpn file, as suggested by dazo.

https://patchwork.openvpn.net/project/o ... stable.cc/

Post Reply