I use two factor authentication for OpenVPN, and I am doing that using the
I also want to store my VPN username and password.
I tried doing this using
auth-user-password up per the man page, but when I do that, it doesn't give me an opportunity to offer a static-challenge, so that fails.
I tried writing a python script that would pass a username, password, and challenge response via stdin to the openvpn process, but openvpn doesn't seem to get any of the things I send to stdin (even though running the same code against a sample script I wrote that gets input using
sys.stdin.readline() worked). A snippet is below.
openvpn = subprocess.Popen( ['openvpn', '--config', os.path.expanduser('~/.ovpn-config')], stdin=subprocess.PIPE) openvpn.communicate('%s\n%s\n%s\n' % (username, password, otp))
Any thoughts on how to both store the username and password and use a static challenge?