Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

I am using openvpn to connect with other server, the problem is that i run it like this

openvpn configfile.ovpn ... and it locks my shell, so, if I close it, the shell gets closed, I was looking for a way to initialize it as daemon, sending my configfile, but I could not find any, I saw the param --configfile but seems like I did not work the way I used it... any idea or way to do it??

I am using linux Debian 6

Thanks

Edit: My .ovpn file is like this:

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
share|improve this question
add comment

marked as duplicate by quanta, EEAA, mgorven, mdpc, Tom O'Connor Feb 23 '13 at 12:21

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 0 down vote accepted

You should use Debian's initscript for OpenVPN. Place your configuration in /etc/openvpn/foo.conf and then start it like this:

sudo service openvpn start foo

The service will be automatically started when the system boots, if you don't want this edit /etc/default/openvpn and change this line:

AUTOSTART="none"

Edit: You can get the client to read the username and password from a file specified with the auth-user-pass directive. This file should contain the username on the first line and password on the second.

auth-user-pass /etc/openvpn/password
share|improve this answer
    
thanks! im trying, but I cant find any docs about an example of how make the foo.conf or openvpn.conf, could you suggest me some links please? –  user156355 Feb 21 '13 at 22:49
    
@user156355 It's exactly the same configuration file that you're already using. –  mgorven Feb 21 '13 at 22:53
    
Thank you!! I moved all my files, configfile.ovpn and the crt (just in case) and I tried service openvpn start client (and client.ovpn) and I get an error, something like this "Starting virtual private network daemon:No such VPN: client.ovpn ... failed!" any idea? –  user156355 Feb 21 '13 at 22:57
    
@user156355 Check /var/log/syslog. You may need to adjust the paths to files like certificates. –  mgorven Feb 21 '13 at 23:00
    
my log file is empty, I updated my post with the code of my conf, could you please give it an eye? –  user156355 Feb 21 '13 at 23:09
show 4 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.