Connect to server by running script

Scripts which allow the use of special authentication methods (LDAP, AD, MySQL/PostgreSQL, etc).

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

Post Reply
droidus
OpenVpn Newbie
Posts: 3
Joined: Sat Aug 11, 2018 2:30 pm

Connect to server by running script

Post by droidus » Thu Oct 31, 2019 10:56 pm

I am writing a script to automatically connect to my VPN server for me, providing my creds. Here is what I have:

Code: Select all

sudo openvpn --auth-user-pass up.txt <host>.udp.ovpn
I am getting this error though:

Code: Select all

Options error: Unrecognized option or missing or extra parameter(s) in [CMD-LINE]:1: auth-user-pass (2.4.4)
After reading the man page on openvpn, I see this:
"Authenticate with server using username/password. up is a file containing username/password on 2 lines (Note: OpenVPN will only read passwords from a file if it has been built with the --enable-password-save configure option, or on Windows by defining ENABLE_PASSWORD_SAVE in win/settings.in).
If up is omitted, username/password will be prompted from the console.

The server configuration must specify an --auth-user-pass-verify script to verify the username/password provided by the client."
I am running Ubuntu on my local host.

Post Reply