nas*_*eeq 10 linux ubuntu openvpn
我在 ubuntu 上有一个 openvpn 设置,多个用户正在连接。我想列出所有活动证书及其通用名称。他们是这样做的吗?
adi*_*tsu 10
如果您使用的是easy-rsa,请检查index.txt文件keys夹中的文件。应包含所有已颁发证书及其主题(包括CN)的清单;有效证书以 a 开头,V吊销证书以开头R。
当前连接列在状态文件中(在我的例子中,openvpn-status.log在openvpn文件夹中)。
您可以简单地这样做:
# cd /etc/openvpn/easy-rsa/2.0/keys/
# cat index.txt | grep ^V | awk -F "/" '{print $7, $8}'
Run Code Online (Sandbox Code Playgroud)
如果证书有效,则行以index.txt开头。V
结果应该是这样的:
CN=guest name=changeme
Run Code Online (Sandbox Code Playgroud)
小智 3
您可以通过管理界面使用 status 命令来获取 OpenVPN 服务器的当前连接列表(请参阅http://openvpn.net/index.php/open-source/documentation/miscellaneous/79-management-interface)。 html),或者查看使用配置文件中的状态行指定的状态文件(请参阅http://openvpn.net/index.php/open-source/documentation/howto.html#server)。
如果你想知道谁可以连接到 OpenVPN 服务器,那就有点困难了。OpenVPN 将允许其证书中包含使用服务器配置使用的 CA 密钥生成的签名的任何人。如果您使用第三方 PKI 基础设施,他们应该拥有其颁发的证书的记录。如果您使用的是 easy-rsa 东西,那么证书应该全部位于该目录中。