You have two choices, one is to use a file containing username and password in clear text (not recommended) the other is using certificate authentication.
To use username and password in a file, use
--auth-user-pass <file> where
<file> is as Jesse_b proposed a file containing username on first line, password on second (community.openvpn.net/openvpn/wiki/Openvpn23ManPage).
However, I think this is bad practice (REALLY!!!!!!!!), you are better off doing certificate authentication, that way, even IF your certificate is retrieved by a 3rd party, they will at least not be able to change the user's password without the root password and many more things, especially if you have
sudo and your user is on the
sudoers list etc ...
You need a to issue the following:
Next, initialize the PKI. On Linux/BSD/Unix:
Note that in the above sequence, most queried parameters were defaulted to the values set in the vars or vars.bat files. The only parameter which must be explicitly entered is the Common Name.
Next, we will generate a certificate and private key for the server. On Linux/BSD/Unix:
Generating client certificates is very similar to the previous step. On Linux/BSD/Unix:
Remember that for each client, make sure to type the appropriate Common Name when prompted, i.e. "client1", "client2", or "client3". Always use a unique common name for each client.
This is easy and so much more secure than using a password with plain text username and password, believe me, please!