Page 1 of 1

Start OpenVPN tunnel without password

Posted: Thu Aug 02, 2012 8:45 pm
by da_zhuang
Dear all:

I'm very new to openvpn, and I need some help with the configuration. I'm using ubuntu 12.04 machine and latest openvpn. I create a script that runs openvpn and put it in /etc/init.d/:

Code: Select all

case "$1" in
'start')
        sudo openvpn --script-security 2 --config /opt/client/client.conf --writepid /opt/client/openvpn.pid
        ;;
'stop')
        sudo killall -9 openvpn
        sudo rm /opt/client/openvpn.pid
        ;;
*)
        echo "Usage: $0 { start | stop }"
        ;;
esac
exit 0
When it gets started, it always asks for password. I want to automate this process and I try to avoid typing password every time, but I don't know what to put in config file.
My config file is this:

Code: Select all

client
proto udp
dev tun
ca ca.crt
dh dh2048.pem
cert client.crt
key client.key
remote 184.106.135.165 1194
cipher AES-256-CBC
user nobody
group nogroup
verb 2
mute 20
comp-lzo
persist-key
persist-tun
float
resolv-retry infinite
daemon
ping 5
ping-restart 10
nobind
push "route 184.0.172.0 255.255.255.0"
push "route 184.0.0.0 255.255.255.0"
push "route 184.0.1.0 255.255.255.0"
push "route 184.0.8.0 255.255.255.0"
push "route 184.0.11.0 255.255.255.0"
push "route 184.0.12.0 255.255.255.0"
push "route 184.0.44.0 255.255.255.0"
push "route 184.0.63.0 255.255.255.0"
push "route 184.0.152.0 255.255.255.0"
push "route 184.0.191.0 255.255.255.0"

Re: Start OpenVPN tunnel without password

Posted: Fri Aug 03, 2012 6:36 am
by maikcat
hi there,
When it gets started, it always asks for password
did you protect client.key with a password?

Michael.