大网数据广告活动
服务器运维问答

remove password prompt openvpn ubuntu client

· 52CE 我爱测

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 fil…

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-08-08)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。