# shaojiemike @ node5 in ~ [23:55:47] $ docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn ovpn_initpki
init-pki complete; you may now create a CA or requests. Your newly created PKI dir is: /etc/openvpn/pki
Using SSL: openssl OpenSSL 1.1.1g 21 Apr 2020
Enter New CA Key Passphrase: Re-Enter New CA Key Passphrase: Generating RSA private key, 2048 bit long modulus (2 primes) .........+++++ ...................+++++ e is 65537 (0x010001) 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. ----- Common Name (eg: your user, host, or server name) [Easy-RSA CA]:tsj-node5
CA creation complete and you may now import and sign cert requests. Your new CA certificate file for publishing is at: /etc/openvpn/pki/ca.crt
Using SSL: openssl OpenSSL 1.1.1g 21 Apr 2020 Generating DH parameters, 2048 bit long safe prime, generator 2 This is going to take a long time ......................+.......................+..........................................................+........................................................................................................+........................................+...................................................................................................................................+.....................................................................................................................+......................................................................................................................................................................................................................................+......++*++*++*++*
DH parameters of size 2048 created at /etc/openvpn/pki/dh.pem
Using SSL: openssl OpenSSL 1.1.1g 21 Apr 2020 Generating a RSA private key .......................................+++++ .........................................+++++ writing new private key to '/etc/openvpn/pki/easy-rsa-73.EeNnaB/tmp.jhHaaF' ----- Using configuration from /etc/openvpn/pki/easy-rsa-73.EeNnaB/tmp.LGnDjB Enter pass phrase for /etc/openvpn/pki/private/ca.key: Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows commonName :ASN.1 12:'node5.xydustc.me' Certificate is to be certified until Jan 1 15:58:37 2025 GMT (825 days) Write out database with 1 new entries Data Base Updated Using SSL: openssl OpenSSL 1.1.1g 21 Apr 2020 Using configuration from /etc/openvpn/pki/easy-rsa-148.CDCEmf/tmp.iJCIGL Enter pass phrase for /etc/openvpn/pki/private/ca.key: An updated CRL has been created.
# shaojiemike @ node5 in ~ [0:16:46] $ docker run -v $OVPN_DATA:/etc/openvpn -d -p 1194:1194/udp --cap-add=NET_ADMIN kylemanna/openvpn cb0f7e78f389f112c3c3b230d20d2b50818f6cf59eea2edfaa076c7e8fad7128
# shaojiemike @ node5 in ~ [0:06:01] $ docker container list CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6c716b27b3f1 kylemanna/openvpn "ovpn_run" 49 seconds ago Up 48 seconds 1194/udp, 0.0.0.0:1195->1195/udp, :::1195->1195/udp charming_zhukovsky
# 上面是错误的
# shaojiemike @ node5 in ~ [0:16:50] $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES cb0f7e78f389 kylemanna/openvpn "ovpn_run" About a minute ago Up About a minute 0.0.0.0:1194->1194/udp, :::1194->1194/udp pedantic_euler
# shaojiemike @ node5 in ~ [0:07:27] C:2 $ docker run -v $OVPN_DATA:/etc/openvpn --rm -it kylemanna/openvpn easyrsa build-client-full tsj-node5-client nopass Using SSL: openssl OpenSSL 1.1.1g 21 Apr 2020 Generating a RSA private key ...............+++++ ...............................+++++ writing new private key to '/etc/openvpn/pki/easy-rsa-1.olaINa/tmp.MfohAO' ----- Using configuration from /etc/openvpn/pki/easy-rsa-1.olaINa/tmp.EMkEHF Enter pass phrase for /etc/openvpn/pki/private/ca.key: 139775495048520:error:28078065:UI routines:UI_set_result_ex:result too small:crypto/ui/ui_lib.c:905:You must typein 4 to 1023 characters Enter pass phrase for /etc/openvpn/pki/private/ca.key: Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows commonName :ASN.1 12:'tsj-node5-client' Certificate is to be certified until Jan 1 16:08:23 2025 GMT (825 days) Write out database with 1 new entries Data Base Updated # shaojiemike @ node5 in ~ [0:08:24] $ docker run -v $OVPN_DATA:/etc/openvpn --rm kylemanna/openvpn ovpn_getclient tsj-node5-client > tsj-node5-client.ovpn # shaojiemike @ node5 in ~ [0:09:20] $ ls tsj-node5-client.ovpn tsj-node5-client.ovpn