启动 openvpn 服务器失败并出现选项错误:--client-config-dir 失败

启动 openvpn 服务器失败并出现选项错误:--client-config-dir 失败

我正在建立一个 openvpn 服务器。我使用 debian jessie 和 easy-rsa 的标准源作为 CA。

一切工作正常,直到我尝试通过 init 脚本启动 openvpn。当我运行时/etc/init.d/openvpn start /var/log/daemon.log 中出现以下错误

Options error: --client-config-dir fails with "/etc/openvpn/easy-rsa/keys/crl.jail//etc/openvpn/server.ccd": No such file or directory

你们中有人知道这些混乱的路径从何而来吗?配置文件中设置的目录存在。 server.conf 文件:

port 1194
proto udp
dev tun

comp-lzo
keepalive 10 120

persist-key
persist-tun
user nobody
group nogroup

chroot /etc/openvpn/easy-rsa/keys/crl.jail
crl-verify crl.pem

ca /etc/openvpn/easy-rsa/keys/ca.crt
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
key /etc/openvpn/easy-rsa/keys/server.key
cert /etc/openvpn/easy-rsa/keys/server.crt

ifconfig-pool-persist /var/lib/openvpn/server.ipp
client-config-dir /etc/openvpn/server.ccd
status /var/log/openvpn/server.log
verb 4

# virtual subnet unique for openvpn to draw client addresses from
# the server will be configured with x.x.x.1
# important: must not be used on your network
server 10.254.1.0 255.255.255.0

# push routes to clients to allow them to reach private subnets
push "route 10.0.0.0 255.0.0.0"

感谢您的帮助。

答案1

我发现了这个错误。 server.ccd 必须位于 crl.jail 目录中。我已经这样更改了配置:

...
chroot /etc/openvpn/easy-rsa/keys/crl.jail
crl-verify crl.pem

ca /etc/openvpn/easy-rsa/keys/ca.crt
dh /etc/openvpn/easy-rsa/keys/dh2048.pem
tls-auth /etc/openvpn/easy-rsa/keys/ta.key 0
key /etc/openvpn/easy-rsa/keys/server.key
cert /etc/openvpn/easy-rsa/keys/server.crt

ifconfig-pool-persist /var/lib/openvpn/server.ipp
client-config-dir server.ccd

...

相关内容