OpenVPN在安全性上比PPTP,L2TP和IPsec都高,因为它通过三个证书的安全验证,实现了整个通信链路的完整加密。
安装步骤:
一、首先检查VPS上的tun设备是否可用,如果不可用需要联系客服打开,否则OpenVPN无法启用。
通过root用户登陆,执行
二、下载安装所需软件包:
三、使用yum安装程序所需开发包
四、安装OpenVPN服务端
1.安装pkcs11-helper RPM包
4.生成证书Key
./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.
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) [CN]:
State or Province Name (full name) [BJ]:
Locality Name (eg, city) [BJ]:
Organization Name (eg, company) [btschina.com]:
Organizational Unit Name (eg, section) []:btschina
Common Name (eg, your name or your server’s hostname) [btschina.com CA]:btschina
.com
Name []:btschina
Email Address [root@btschina.com]:
5.建立 server key
Email Address [root@btschina.com]:</p>
<p>Please enter the following ‘extra’ attributes
to be sent with your certificate request
A challenge password []:123456
An optional company name []:btschina.com
Using configuration from /etc/openvpn/easy-rsa/2.0/openssl.cnf
Check that the request matches the signature
Signature ok
The Subject’s Distinguished Name is as follows
countryName :P RINTABLE:’CN’
stateOrProvinceName :P RINTABLE:’BJ’
localityName :P RINTABLE:’BJ’
organizationName :P RINTABLE:’btschina.com’
organizationalUnitName:PRINTABLE:’btschina’
commonName :P RINTABLE:’btschina.com’
name :P RINTABLE:’btschina’
emailAddress :IA5STRING:’root@btschina.com’
Certificate is to be certified until Apr 12 08:21:52 2021 GMT (3650 days)
Sign the certificate? [y/n]:y
</div>
6.生成客户端 key