我在哪里设置OpenVPN服务器的用户名和密码?

我无法find编辑5年前安装的VPN用户密码的地方。 我对这个东西不是很了解,很惊讶我很多年前都做这个工作。

这是一个运行OpenVPN的Centos服务器 – PPTP服务器,用户连接一个简单的用户名和密码。 用户名/密码不是服务器的用户 – 我记得他们是以{username}:{password}的forms以纯文本forms存储在文件中的。

我不记得这个文件的存储位置! 任何想法如何find它?

我的/etc/openvpn/server.conf文件如下所示:

 local xx.xx.xx.xx port 1194 proto udp dev tun tun-mtu 1500 tun-mtu-extra 32 mssfix 1450 ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt cert /etc/openvpn/easy-rsa/2.0/keys/server.crt key /etc/openvpn/easy-rsa/2.0/keys/server.key dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem server 10.8.0.0 255.255.255.0 push "route 10.104.17.0 255.255.255.0" route 192.168.5.0 255.255.255.0 client-config-dir /etc/openvpn/client-configs ifconfig-pool-persist /etc/openvpn/ipp.txt keepalive 5 30 comp-lzo persist-key persist-tun status 1194.log verb 5 daemon 

你确定你的OpenVPN服务器正在服务你的PPTP连接吗? 我要求正式OpenVPN不支持PPTP协议,你可能需要使用openvpn客户端来连接到您的openvpn服务器。

从OpenVPN手册引用:

OpenVPN是否支持IPSec或PPTP?

现在有三种主要的VPN实施方式:SSL,IPSec和PPTP。 OpenVPN是一个SSL VPN,因此与IPSec,L2TP或PPTP不兼容。

另外,如果openVPN使用基于用户名/密码的身份validation,我希望在您的configuration文件中看到一个身份validationconfiguration指令来分配login方法; 因为OpenVPN默认使用基于证书的身份validation。

我的build议:如果您确定您正在运行PPTP,请检查您是否正在运行提供这些连接的pptpd守护进程。 如果你使用的是openvpn,你可以用客户端configuration文件来更新你的问题,这样可以帮助我们确定你正在使用的login方法,但是通过这个configuration来判断它可能是基于证书的。 关于你的设置密钥生成的更多信息可以在这里find: https : //openvpn.net/easyrsa.html ,本质上你生成一个密钥,下载并分发给你的任何用户,“.ovpn”configuration文件和您的公共ca证书。

如果您对pptpd或openvpn的configuration有任何疑问,请随时提问。

以下是您如何创build一个新的OpenVPN用户:

转到/etc/openvpn/easy-rsa/2.0

然后,用你最喜欢的编辑器编辑variables文件。

当你完成保存文件并运行:

 source ./vars 

然后运行:

 ./build-key-pass username 

以下是一个输出示例:

 [root@centolel 2.0]# ./build-key-pass itaitikal Generating a 1024 bit RSA private key .++++++ ...........++++++ writing new private key to 'itaitikal.key' Enter PEM pass phrase: Verifying - Enter PEM pass phrase: ----- 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) [IL]: State or Province Name (full name) [SH]: Locality Name (eg, city) [TelAviv]: Organization Name (eg, company) [none]: Organizational Unit Name (eg, section) [changeme]: Common Name (eg, your name or your server's hostname) [itaitikal]: Name [itaitikal1]: Email Address [[email protected]]: 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/2.0/openssl-1.0.0.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows countryName :PRINTABLE:'IL' stateOrProvinceName :PRINTABLE:'SH' localityName :PRINTABLE:'TelAviv' organizationName :PRINTABLE:'none' organizationalUnitName:PRINTABLE:'changeme' commonName :PRINTABLE:'itaitikal' name :PRINTABLE:'itaitikal1' emailAddress :IA5STRING:'[email protected]' Certificate is to be certified until Feb 20 15:44:56 2027 GMT (3650 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated 

确保CN名称是唯一的,否则您将无法签名证书。

接下来,浏览到/etc/openvpn/easy-rsa/2.0/keys ,并将刚刚创build的username.crtusername.key以及服务器的ca.crt压缩并发送给用户。

用户将不得不把他们放在某个地方,并在他的.ovpn文件中指向他们。

我写了一篇关于整个程序的文章,请随时查看:

http://www.geek-kb.com/install-and-configure-openvpn-centos-6-x/