Bluedevil678
Bluedevil678

Reputation: 120

Pre-answer raw_input for Openvpn

How would I be able to allow automatic population of the password required when opening the openvpn scrip? Even if just for testing it was supplied as a string

import subprocess

def connect():
subprocess.call(["sudo","openvpn", "BMHQ-client.conf"])

connect()

This would prompt for a password however I would like the simplest way to not have to enter that password.

Upvotes: 0

Views: 81

Answers (2)

iNoob
iNoob

Reputation: 1395

Arr I see what you mean now. You want to per-populate the sudo password.

use the -S option for sudo

so could do something like the below in your script. (again not very secure)

echo mypassword | sudo -S command

Upvotes: 0

iNoob
iNoob

Reputation: 1395

you can populate it by sticking your creds into another file and calling that from your config.

add this line to your config auth-user-pass login.conf

and create another file with your credits in it called login.conf.

Username

password

Upvotes: 1

Related Questions