Here's how you create a new OpenVPN user:
Then, edit with your favorite editor the vars file.
when you finish save the file and run:
Here's an example output:
[root@centolel 2.0]# ./build-key-pass itaitikal
Generating a 1024 bit RSA private key
writing new private key to 'itaitikal.key'
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
Country Name (2 letter code) [IL]:
State or Province Name (full name) [SH]:
Locality Name (eg, city) [TelAviv]:
Organization Name (eg, company) [none]:
Organizational Unit Name (eg, section) [changeme]:
Common Name (eg, your name or your server's hostname) [itaitikal]:
Email Address [firstname.lastname@example.org]:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password :
An optional company name :
Using configuration from /etc/openvpn/easy-rsa/2.0/openssl-1.0.0.cnf
Check that the request matches the signature
The Subject's Distinguished Name is as follows
Certificate is to be certified until Feb 20 15:44:56 2027 GMT (3650 days)
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
Write out database with 1 new entries
Data Base Updated
Make sure that the CN name is unique, otherwise you won't be able to sign the certificate.
Next, browse to
/etc/openvpn/easy-rsa/2.0/keys and take the
username.key that you've just created and the server's
ca.crt, zip them and send them to the user.
The user will have to place them somewhere and point to them in his .ovpn file.
I wrote an article about this whole procedure, so feel free to check it out: