快速业务通道

linux下OPENVPN安装详解

作者 佚名技术 来源 Linux系统 浏览 发布时间 2012-04-23

安裝openvpn
3.1 server
# 安裝 lzo
在网站上下载lzo*.tar.gz的包
tar -zxvf lzo*.tar.gz
cd lzo*
./configure
make && make install


# 安裝 openvpn
cd /usr/local/src
wget http://openvpn.net/release/openvpn-2.0.9.tar.gz
tar -zxvf openvpn-2.0.9.tar.gz
cd openvpn-2.0.9
./configure
make && make install


# 复制设定规范
cp -r /usr/local/src/openvpn-2.0.9/ /etc/openvpn/
cp -r /usr/local/src/openvpn-2.0.9/sample-config-files/server.conf /etc/openvpn/
# 设定 CA 环境
cd /etc/openvpn/easy-rsa/ //当然你也可以不写
vi vars
export KEY_COUNTRY=TW
export KEY_PROVINCE=Taiwan
export KEY_CITY=Tainan
export KEY_ORG="Study-Area"
export KEY_EMAIL="netman@study-area.org"
. ./vars
./clean-all

# 建立 root CA
./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) [TW]:
State or Province Name (full name) [Taiwan]:
Locality Name (eg, city) [Tainan]:
Organization Name (eg, company) [Study-Area]:
Organizational Unit Name (eg, section) []:test
Common Name (eg, your name or your server''s hostname) []:CA
Email Address [netman@study-area.org]:

# 建立 server key 及 crt
./build-key-server S1
Generating a 1024 bit RSA private key
............................
....
writing new private key to ''ovpnsrv1.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) [TW]:
State or Province Name (full name) [Taiwan]:
Locality Name (eg, city) [Tainan]:
Organization Name (eg, company) [Study-Area]:
Organizational Unit Name (eg, section) []:test
Common Name (eg, your name or your server''s hostname) []:ovpnsrv1
Email Address [netman@study-area.org]:

Please enter the following ''extra'' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
Using configuration from /etc/openvpn/easy-rsa/openssl.cnf
Check that the request matches the signature
Signature ok
The Subject''s Distinguished Name is as follows
countryName :PRINTABLE:''TW''
stateOrProvinceName :PRINTABLE:''Taiwan''
localityName :PRINTABLE:''Tainan''
organizationName :PRINTABLE:''Study-Area''
organizationalUnitName:PRINTABLE:''tes

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号