问题原文
原帖链接 · Ian Arman · CC BY-SA 4.0
I'm trying to save the username, and password of my openvpn client in .secret.txt, and I'm receiving errors when attempting to connect, or the password is requested, instead of being read from .secret.txt.
Here is my config file:
resolv-retry infinite
nobind
persist-key
persist-tun
key-direction 1
remote-cert-tls server
tls-version-min 1.2
verify-x509-name server_4EBX2EpXPZasiTv1 name
cipher AES-256-CBC
auth SHA256
comp-lzo
verb 3
<ca>
auth-user-pass //root/.secret.txt
When attempting to connect, I'm still being prompted for a password:
Wed Aug 8 07:44:22 2018 OpenVPN 2.4.3 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 3 2017
Wed Aug 8 07:44:22 2018 library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08
Enter Private Key Password:
社区高分解答
原帖链接 · Håkan Lindqvist · CC BY-SA 4.0
"Enter Private Key Password" suggests you may be barking up the wrong tree.
It sounds like you are authenticating based on PKI and your private key is encrypted and requires a password to use (an entirely local process).
auth-user-pass, on the other hand, is for authenticating to the VPN server with username and password, which is unrelated.
One option of dealing with your actual problem is to store your private key in the plain, so that no password is necessary to use it.
This can be done using openssl rsa, something like:
openssl rsa -in file1.key -out file2.key
And then instead using the new file in your openvpn config.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
