Openvpn save password without recompiling using bash

If you need a way to launch an openvpn client that uses auth-user-pass without having to recompile openvpn with --enable-password-save you could use a simple shell script.


#!/usr/bin/expect
spawn openvpn –config /etc/openvpn/configforclient.conf
expect “*Username:*”
send “userhere\r”
expect “*Password:*”
send “passhere\r”
interact

Just replace userhere and passhere with your vpn username and password. Saving your login credentials in plain text may be a security risk. Keep that in mind!
You also have to have the expect package installed on your computer.

This entry was posted in Computer software and tagged , , , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>