如何将 openvpn 作为发送配置文件的守护进程运行?

use*_*355 2 debian openvpn

我正在使用 openvpn 连接其他服务器,问题是我是这样运行的

openvpn configfile.ovpn...它锁定了我的外壳,所以,如果我关闭它,外壳就会关闭,我正在寻找一种方法将它初始化为守护进程,发送我的配置文件,但我找不到任何,我看到了参数,--configfile但似乎就像我没有按照我使用的方式工作……有什么想法或方法吗?

我正在使用 linux Debian 6

谢谢

编辑:我的 .ovpn 文件是这样的:

dev tap
client
proto tcp-client
ca /etc/openvpn/ca.crt
cert /etc/openvpn/client.crt
key /etc/openvpn/client.pem
tls-remote "/O=WatchGuard_Technologies/OU=Fireware/CN=Fireware_SSLVPN_Server"
remote-cert-eku "TLS Web Server Authentication"
remote someIP 
persist-key
persist-tun
verb 3
mute 20
keepalive 10 60
cipher BF-CBC
auth MD5
float 1
reneg-sec 3660
nobind
mute-replay-warnings
auth-user-pass
Run Code Online (Sandbox Code Playgroud)

mgo*_*ven 7

您应该将 Debian 的 initscript 用于 OpenVPN。放置您的配置,/etc/openvpn/foo.conf然后像这样启动它:

sudo service openvpn start foo
Run Code Online (Sandbox Code Playgroud)

该服务将在系统启动时自动启动,如果您不想进行此编辑/etc/default/openvpn并更改此行:

AUTOSTART="none"
Run Code Online (Sandbox Code Playgroud)

编辑:您可以让客户端从auth-user-pass指令指定的文件中读取用户名和密码。该文件应在第一行包含用户名,在第二行包含密码。

auth-user-pass /etc/openvpn/password
Run Code Online (Sandbox Code Playgroud)