我有一个从 OpenVPN 服务器导出的 .ovpn 文件:
dev tun
persist-tun
persist-key
cipher AES-256-CBC
auth SHA512
client
resolv-retry infinite
remote xxx.xxx.xxx.xxx 1194 udp
lport 0
verify-x509-name "C=xxx, ST=xxx, L=xxx, O=xxx, [email protected], CN=xxx" subject
remote-cert-tls server
auth-user-pass auth.txt
comp-lzo adaptive
pkcs12 xxx.p12
tls-auth xxx-tls.key 1
当然,我有从同一个 OpenVPN 服务器导出的 auth.txt、xxx.p12 和 xxx-tls.key 文件
有人可以解释一下我吗,我要如何在 Ubuntu 22.04 上用这些文件配置客户端?
我已经安装了 openvpn ( apt-get install openvpn
)
将所有文件放入/etc/openvpn/client
试着openvpn --config /etc/openvpn/client/xxx.ovpn
有錯誤Cannot pre-load keyfile (xxx-tls.key)
我不确定这些步骤是否正确...
答案1
这对我有帮助:
- 从服务器导出一个 .ovpn 文件,而不是多个:
dev tun
persist-tun
persist-key
cipher AES-256-CBC
auth SHA512
client
resolv-retry infinite
remote xxx.xxx.xxx.xxx 1194 udp
lport 0
verify-x509-name "C=xxx, ST=xxx, L=xxx, O=xxx, [email protected], CN=xxx" subject
remote-cert-tls server
auth-user-pass auth.txt
comp-lzo adaptive
<ca>
-----BEGIN CERTIFICATE-----
***DATA***
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
***DATA***
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
***DATA***
-----END PRIVATE KEY-----
</key>
<tls-auth>
#
# 2048 bit OpenVPN static key
#
-----BEGIN OpenVPN Static key V1-----
***DATA***
-----END OpenVPN Static key V1-----
</tls-auth>
key-direction 1
- 将 .ovpn 文件重命名为
client.conf
- 复制
client.conf
并auth.txt
发送至/etc/openvpn
- 跑步
systemctl start openvpn@client