I am using IPVanish for using a proxy while surfing; like:
sudo openvpn --config /home/ipv/conf/ipvanish-CA-Toronto-tor-a09.ovpn
Now, I have to enter my username, after that my password. How Can I pass those two params right as one command, so that I just use one command and the username/password are being passed automatically?
Following @Fluffy answer (unfortunately I don't have enough reputation to comment)
There is a nice bash trick that can eliminate need for pass.txt file
Insead of
where pass.txt is
one can use
I'm not new here, but this is my first contribution
This is what I did: (I'm a noob, advices are welcomed)
Seems to me like you have a config file .ovpn with the configuration needed, you need to create a new file that contains the username and password, you can do it like this
Add this lines, save and exit
Now go the the .ovpn config file and edit, there should be a line that reads auth-user-pass
Add your username and password file
Ok so now you should be able to authenticate to the VPN just by executing your .ovpn file
If you need to do something like RDP there is also a way to authenticate without typing the password everytime using a #!/bin/bash script, let me know if you need help :)
The previous answer didn't work for me (still asked for username and password), what did work was putting your credentials in a file (pass.txt), like this
and calling openvpn with
--auth-user-pass pass.txt
.source