Page 1 of 1

How to create a single ovpn file

Posted: Mon May 17, 2021 3:21 am
by elrolo192
Hello. I am new in openvpn and I am trying to create a single file .ovpn to send to my clients. I've succesfully created a mikrotik certificates ca and cert and key and put all together in a single ovpn file. My question is. Can I add the username and password in the same file so that my clients only need to import the ovpn file and no need to use a file with auth-user-pass extra-file or the openvpn don't ask for the username and password? Is there an option I can use like the <ca> for the certificate to add the username and password in the ovpn file?

Re: How to create a single ovpn file

Posted: Mon May 17, 2021 6:29 pm
by TinCanTech
elrolo192 wrote:
Mon May 17, 2021 3:21 am
Is there an option I can use like the <ca> for the certificate to add the username and password in the ovpn file?
No, that would be a very bad idea.

Re: How to create a single ovpn file

Posted: Thu May 20, 2021 10:08 am
by zxun
I think what you want is a simple point-to-point tunnel.
If you are sure that your openvpn server will only have one client, you can do so even without ca.

However I suggest you should set up basic password authentication, which could be stored in config of the client.

Re: How to create a single ovpn file

Posted: Thu May 20, 2021 11:21 am
by TinCanTech
zxun wrote:
Thu May 20, 2021 10:08 am
I suggest you should set up basic password authentication, which could be stored in config of the client
The username and password cannot be stored in the config file :!:

Re: How to create a single ovpn file

Posted: Thu May 20, 2021 1:22 pm
by zxun
TinCanTech wrote:
Thu May 20, 2021 11:21 am
The username and password cannot be stored in the config file :!:
Sorry, but I stored it in another file in the same directory with the config file

Code: Select all

auth-user-pass password.txt

Re: How to create a single ovpn file

Posted: Thu May 20, 2021 1:36 pm
by TinCanTech
Yes, that is acceptable.

However, the point of a password is to ensure a human is typing it in not having it automated.

Re: How to create a single ovpn file

Posted: Fri May 21, 2021 12:30 am
by elrolo192
Thanks for the help, so I understand that there is no way to put the username and password inside the ovpn file. I understand the point of security, in this case unfortunately the people who want to use are "important" in my work and they don't want extra stepts to connect their computers. However I think I will make a manual to import the file and make everyone to use a username and password.