网络管理员无法连接 VPN

网络管理员无法连接 VPN

我正在使用 Ubuntu 20.4.3 和 OpenVPN 2.4.7。

我可以通过命令行连接到我的 VPN(需要 2FA):openvpn myconffile.conf

它提示我输入用户名,然后输入验证码,最后输入 OTP。之后一切正常。

我尝试通过网络管理器设置 VPN,但失败了。

我进入网络 / 添加 VPN / 从文件导入 / 选择我的配置文件。我仔细检查了文本编辑器中的信息与网络管理器中的参数。所有内容均已正确填充在 GUI 中。

当我点击连接时,每次都会提示“需要验证”——需要密码。我输入密码并点击“连接”。它一直提示。最后它说:“连接失败”。

我在 DEBUG 中启用了网络管理器:sudo NetworkManager --log-level=DEBUG

然后检查日志以捕获错误:tail -f /var/log/syslog。我可以看到那里有一个身份验证失败信息:AUTH:收到控制消息:AUTH_FAILED

原始日志在此:

NetworkManager[1148]: <info>  [1631159937.7269] audit: op="connection-activate" uuid="xyz" name="xyz" pid=2120 uid=1000 result="success"
NetworkManager[1148]: <info>  [1631159937.7303] vpn-connection[xyz,xyz,"xyzxyz",0]: Started the VPN service, PID 7496
NetworkManager[1148]: <info>  [1631159937.7350] vpn-connection[xyz,xyz,"xyzxyz",0]: Saw the service appear; activating connection
NetworkManager[1148]: <info>  [1631159937.7426] vpn-connection[xyz,xyz,"xyzxyz",0]: VPN plugin: state changed: starting (3)
NetworkManager[1148]: <info>  [1631159937.7426] vpn-connection[xyz,xyz,"xyzxyz",0]: VPN connection: (ConnectInteractive) reply received
nm-openvpn[7500]: OpenVPN 2.4.7 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 19 2021
nm-openvpn[7500]: library versions: OpenSSL 1.1.1f  31 Mar 2020, LZO 2.10
nm-openvpn[7500]: NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
nm-openvpn[7500]: TCP/UDP: Preserving recently used remote address: [AF_INET]IP_HERE:PORT_HERE
nm-openvpn[7500]: UDP link local: (not bound)
nm-openvpn[7500]: UDP link remote: [AF_INET]IP_HERE:PORT_HERE
nm-openvpn[7500]: NOTE: chroot will be delayed because of --client, --pull, or --up-delay
nm-openvpn[7500]: NOTE: UID/GID downgrade will be delayed because of --client, --pull, or --up-delay
nm-openvpn[7500]: [HOST_HERE] Peer Connection Initiated with [AF_INET]IP_HERE:PORT_HERE
nm-openvpn[7500]: AUTH: Received control message: AUTH_FAILED
nm-openvpn[7500]: SIGUSR1[soft,auth-failure] received, process restarting

是的,我输入的密码写得很好。我保证 :)

你知道为什么这可以通过控制台而不是在网络管理器中工作吗?我遗漏了什么?我该如何进一步检查?

先谢谢了!

答案1

我遇到了同样的问题,这似乎是一个已知的错误。

链接1 链接2 链接 3

问题在于网络管理员将 2FA 代码存储到密码字段中。

确实有解决方法,但效果并不好:
通过网络管理器使用 2fA 的 Openvpn 覆盖已保存的密码
我宁愿不为此而阻止 login.keyring

如何使用双因素身份验证顺利通过 openvpn 登录?
此解决方法建议将密码存储在纯文本文件中。

https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/-/issues/12#note_863618

看来我们必须等到有人能修复这个错误/不良行为。

相关内容