Where is "openvpn.conf" located?

Connection sharing, Firewall, Samba..etc
Forum rules
Before you post please read how to get help
Post Reply
Captain Brillo
Level 3
Level 3
Posts: 131
Joined: Mon Oct 23, 2017 9:38 pm

Where is "openvpn.conf" located?

Post by Captain Brillo » Fri Dec 28, 2018 5:34 pm

As per this article https://www.maketecheasier.com/connect- ... lly-linux/

Trying to automate VPN connection and these instructions are giving me a problem:
Open “/etc/openvpn/openvpn.conf” with sudo. Look for a line that contains “auth-user-pass.” It’ll probably be sitting there alone with nothing else on the line. After it, add “auth.txt” on the same line. Save the file and close it.

Create a new file in “/etc/openvpn” called “auth.txt.” On the first line of the file, place your username. Include your password on the second line. There is no need for anything else in the file. Save and close it.
I've tried "storing" the password for every user in "Network Connections" but that doesn't work.
Can't find that conf file, so where is it that I automate this?
Every time I bork the Linux box, I learn something new - what a blast!
If it ain't broke, fix it anyway! Ha Ha!

rene
Level 11
Level 11
Posts: 3627
Joined: Sun Mar 27, 2016 6:58 pm

Re: Where is "openvpn.conf" located?

Post by rene » Fri Dec 28, 2018 6:25 pm

/etc/openvpn/openvpn.conf is actually something you have to create and which is specific for each VPN provider and server and protocol (TCP and UDP) thereof; you can usually download the files (generally named e.g. us-123.foovpn.com.udp1194.ovpn) from the VPN provider; I keep e.g. FooVPN's .opvn files in /etc/openvpn/client/FooVPN and link the one I aim to in fact use as /etc/openvpn/openvpn.conf.

That is however not generally advisable. NetworkManager manages multiple VPN connections nicely: what does not work for you? If you want to map multiple FooVPN usernames onto a single Linux user just create multiple VPN connections, one for each FooVPN username.

So as to use NetworkManager: click network icon in systray -> Network Connections -> + -> Import a saved VPN configuration -> Create -> browse to an .ovpn file as mentioned above as well and as downloaded from FooVPN -> Add e.g. "(username)" to the connection name and fill in the FooVPN username and password -> Save.

Captain Brillo
Level 3
Level 3
Posts: 131
Joined: Mon Oct 23, 2017 9:38 pm

Re: Where is "openvpn.conf" located?

Post by Captain Brillo » Fri Dec 28, 2018 6:41 pm

Thanks, but that's not the problem; I've put the password there for all users, doesn't help at startup, I'm still asked for the password.

What I'm trying to do is automate openvpn connection at startup without needing to enter any password info.
As the referenced article says, I need to find the file with this in it (look at the link!):
cipher AES-256-CBC
auth SHA512
tls-cipher TLS...
...
nobind
auth-user-pass...
So far I can't find it.

I don't know how to automate this without somebody else's app/program; the article mentioned above shows how to do this, if I can find the right file to edit.

The desired result will be seamless VPN connection at startup.
Every time I bork the Linux box, I learn something new - what a blast!
If it ain't broke, fix it anyway! Ha Ha!

Pippin
Level 4
Level 4
Posts: 272
Joined: Wed Dec 13, 2017 11:14 am
Location: NL/DE/TH

Re: Where is "openvpn.conf" located?

Post by Pippin » Fri Dec 28, 2018 6:50 pm

Code: Select all

auth-user-pass /etc/openvpn/passwordfile
;)
Everything is electric.

rene
Level 11
Level 11
Posts: 3627
Joined: Sun Mar 27, 2016 6:58 pm

Re: Where is "openvpn.conf" located?

Post by rene » Fri Dec 28, 2018 7:05 pm

Captain Brillo wrote:
Fri Dec 28, 2018 6:41 pm
So far I can't find it.
As I spelled out already, you need to create /etc/openvpn/openvpn.conf. The by yourself linked article does so by copying a by the VPN provider provided .ovpn file; I myself suggested to simply link that file. Whichever way, the .ovpn file you should get from your VPN provider.
Last edited by rene on Fri Dec 28, 2018 7:09 pm, edited 1 time in total.

User avatar
Gruppo Sportivo
Level 3
Level 3
Posts: 122
Joined: Sun May 28, 2017 4:14 am
Location: Rotterdam (NL)

Re: Where is "openvpn.conf" located?

Post by Gruppo Sportivo » Fri Dec 28, 2018 7:05 pm

Try this:

Code: Select all

sudo nano /etc/openvpn/login.conf
Add 2 lines for login and password. Line one is going to be your VPN access login and line two is going to be your password. To save and exit Nano press CTRL -x it will ask you to save it type Y

Set the proper permissions for the conf file:

Code: Select all

sudo chmod 400 /etc/openvpn/login.conf
Create a new config file with your VPN information name.ovpn

Code: Select all

sudo cp name.ovpn /etc/openvpn/name.conf
By adding the new line OpenVPN automatically knows where to grab the password:

Code: Select all

sudo nano /etc/openvpn/name.conf
At the line auth-user-pass add login.conf so it looks exactly like auth-user-pass login.conf
Image

Image

Captain Brillo
Level 3
Level 3
Posts: 131
Joined: Mon Oct 23, 2017 9:38 pm

Re: Where is "openvpn.conf" located?

Post by Captain Brillo » Fri Dec 28, 2018 7:29 pm

My bad.
And thank you.
I just wasn't getting the "create" part.

Got it now.... :oops:
Every time I bork the Linux box, I learn something new - what a blast!
If it ain't broke, fix it anyway! Ha Ha!

Post Reply

Return to “Other networking topics”