Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…


Cannot retrieve contributors at this time

file 37 lines (28 sloc) 1.281 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
OpenVPN sh authentication script with simple user db
for use withauth-user-pass-verify via-file option

It's a simple sh shell script that is target at consumer routers that dont't
have perl or any other scripting languages installed on them,
but need a simple ovpn authentication


1) copy script to your server,
make it executable (chmod +x) and make sure you can execute it

2) create a file named ovpnauth.conf and put it inside for example

3) for each user you want to register
3a) compute md5 checksum using this md5 password
3b) add line in your ovpnauth.conf that reads like this:
where [computed-md5-password] is md5 checksum you computed

4) edit and make sure your conf path (path to ovpnauth.conf) is correct
4a) (optional) you can change your logfile path

5) now in your openvpn.conf add this options
script-security 2
auth-user-pass-verify via-file
   also you can replace with full path to your ovpnauth script

6) Enjoy sh shell based OpenVPN authentication
  and don't forget to specify auth-user-pass option in
your openvpn client config
Something went wrong with that request. Please try again.