Start OpenVPN tunnel without password

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
da_zhuang
OpenVpn Newbie
Posts: 1
Joined: Thu Aug 02, 2012 8:34 pm

Start OpenVPN tunnel without password

Post by da_zhuang » Thu Aug 02, 2012 8:45 pm

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"

User avatar
maikcat
Forum Team
Posts: 4200
Joined: Wed Jan 12, 2011 9:23 am
Location: Athens,Greece
Contact:

Re: Start OpenVPN tunnel without password

Post by maikcat » Fri Aug 03, 2012 6:36 am

hi there,
When it gets started, it always asks for password
did you protect client.key with a password?

Michael.
Amiga 500 , Zx +2 owner
Long live Dino Dini (Kick off 2 Creator)

Inflammable means flammable? (Dr Nick Riviera,Simsons Season13)

"objects in mirror are losing"

Post Reply