Skip to content

Instantly share code, notes, and snippets.

@SumonMSelim
Last active November 26, 2021 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SumonMSelim/aa7abb50ceea67eed1502fa189ed55f5 to your computer and use it in GitHub Desktop.
Save SumonMSelim/aa7abb50ceea67eed1502fa189ed55f5 to your computer and use it in GitHub Desktop.
Creating the Server Certificate, Key, and Encryption Files

Server: Keypair and certificate request

req: /home/sumon/openvpn/EasyRSA/pki/reqs/server.req
key: /home/sumon/openvpn/EasyRSA/pki/private/server.key

CA: import request with server.req file

./easyrsa import-req /home/deploy/openvpn/server.req server

CA: perform signing operations on the request

./easyrsa sign-req server server

Output

Certificate created at: /home/deploy/openvpn/EasyRSA/pki/issued/server.crt

CA: transfer the signed certificate back to VPN server

scp /home/deploy/openvpn/EasyRSA/pki/issued/server.crt sumon@103.138.150.203:/home/sumon/openvpn/CA/

CA: transfer the ca.crt file to VPN server

scp /home/deploy/openvpn/EasyRSA/pki/ca.crt sumon@103.138.150.203:/home/sumon/openvpn/CA/

Server: copy the server.crt and ca.crt files into your /etc/openvpn/ directory

sudo cp /home/sumon/openvpn/CA/{server.crt,ca.crt} /etc/openvpn/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment