Is there any documentation or resource describing how to generate and host a profile for an OpenVPN client to import? Ideally would like my users to not have to separately fetch a .zip file of the .ovpn + certs, extract it to the proper directory, tweak their .ovpn, etc.
Apparently since OpenVPN 2.1 a inline configuration has been supported. Allowing you to locate your certs, and keys all in a single configuration file. But the documentation about how to create this configuration file was not added until the recent release of 2.3.
See the
INLINE FILE SUPPORT
section of the OpenVPN man page for more info.The docs for the config file are the same as the docs for the commandline options:
From the OpenVPN 2.3 man page (It is supported since 2.1rc-something):
Also Note the
key-direction
option:This has been tested with OpenVPN 2.3.4 Debian 8.9 Server with Win7 clients.
Step 1. Create a file containing your defaults (I call it inline_client.conf) all settings must match your server.conf values
Step 2. Create the following script, adjust paths as required and
chmod ug+x MakeInline.sh
Step 3. Execute
MakeInline.sh
it will ask for the name of a client which you needed to have already created withbuild-key or build-key-pass
. It will ask for a name for the ovpn file. My standard is ServerToConnectTo.ClientName which will produceServerToConnectTo.ClientName.ovpn
Note: if you used
build-key
instead ofbuild-key-pass
then anyone that gets hold of the*.ovpn
will have access to your server without a password!This Python script can be run on the server to generate the client keys and a profile. I'd inline it but it is not my creation and is long and may be updated periodically, and there are forks of it so odds are it will be searchable on the web for future web travelers. If the link doesn't work try searching "openvpn_gen.py".
https://gist.github.com/Justasic/908ef5f4fa162f15b3b8