openvpn and PKI and Synology CS407
The following is a summary of all required steps to enable your CS407 to use openvpn with your own PKI – I was following these instructions. If you want to install and configure openvpn, follow this link.
- download and extract openvpn-2.x.zip
- copy easy-rsa folder to /opt/etc/openvpn/easy-rsa
- edit vars in folder /opt/etc/openvpn/easy-rsa
export KEY_CONFIG=/opt/etc/openvpn/easy-rsa/openssl.cnf
export KEY_DIR=/opt/etc/openvpn/private.lan/keys
export KEY_COUNTRY=YOURCOUNTRY
export KEY_PROVINCE=YOURPROVINCE
export KEY_CITY=YOURCITY
export KEY_ORG=”YOURCOMPANY”
export KEY_EMAIL=”YOUREMAILADDRESS” - switch to bash shell: bash-3.2#
- . vars
- ./clean-all
As you create certificates, keys, and certificate signing requests, understand that only .key files should be kept confidential. .crt and .csr files can be sent over insecure channels such as plaintext email.
- Start with building your own Certificate Authority
- ./build-ca
Generating a 1024 bit RSA private key, writing new private key to ‘ca.key’
You are about to be asked to enter information that will be incorporated into your certificate request. This information is retrieved from your vars file
For the Common Name use e.g. a combination of your server name and MAC address: CS4071101AF2018964
- Create your server key files
- ./build-key-server server
Generating a 1024 bit RSA private key, writing new private key to ’server.key’
Common Name (eg, your name or your server’s hostname) :cs407
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
- Then create your client key files
- ./build-key thinkpad
Generating a 1024 bit RSA private key, writing new private key to ‘thinkpad.key’
Common Name (eg, your name or your server’s hostname) []:thinkpad
Sign the certificate? [y/n]:y
1 out of 1 certificate requests certified, commit? [y/n]y
- Generate Diffie Hellman parameters
- ./build-dh
Using tls-auth requires that you generate a shared-secret key that is used in addition to the standard RSA certificate/key:
- openvpn –genkey –secret ta.key
In the server configuration file (server.ovpn), add:
tls-auth ta.key 0
max-clients 5 (or any number)
Copy the following files to the CS407 folder /opt/etc/openvpn/config:
- ca.crt
- dh1024.pem
- server.crt
- server.key
- server.ovpn
- ta.key
Copy the following files to your client folder C:\Program Files\OpenVPN\config
- ca.crt
- thinkpad.crt
- thinkpad.key
- client.ovpn
- ta.key
In the client configuration file (client.ovpn), add:
tls-auth ta.key 1
Restart openvpn on your CS407 and connect your openvpn client:
cd /opt/etc/init.d
sh S24openvpn
In case you need to revoke access for specific users:
. vars
./revoke-full “clientname”
Comments (One comment)
[...] ==> next step is to create your own PKI, which you will find here [...]
openvpn with Synology CS407 at my blog / January 3rd, 2009, 18:32 / #
Post a comment