apt install openvpn openssl easy-rsa
NOTE: The easy-rsa will make the creation of certificates much easier.
Change the directory to the easy-rsa directory in the OpenVPN directory:
cd /etc/openvpn/easy-rsa/
NOTE: If the directory is not there, copy it over:
cp -R /usr/share/easy-rsa/* easy-rsa/
Modify the vars file in the easy-rsa directory:
vi vars
Change the following lines to your needs:
export KEY_SIZE=2048 export KEY_COUNTRY="JE" export KEY_PROVINCE="La Pouquelaye" export KEY_CITY="St. Helier" export KEY_ORG="local" export KEY_EMAIL="openvpn@domain.local" export KEY_OU="domain.local"
./vars
./clean-all
ALERT: Keep these secure!
./build-ca
NOTE: This will create the following files needed for the CA to sign certificates.
./build-key-server test.domain.local
NOTE: This will generate the server certificate files which is used by the OpenVPN server.
./build-dh
NOTE: This will create this file:
./build-key client.domain.local
NOTE: This needs to be done for every client and will create those files:
The following files need to be copied.