Save username and password of openvpn in encrypted format

2

1

While searching on internet I have found that we can automate vpn login via editing config file through adding auth-user-pass login.conf and create login.cnf file and add your credentials in pure text format.

But the issue here is that anyone can get the password just accessing that login.conf file. Is there any way we can encrypt/encode password or username and password both.

Or any other alternative to automate login.

foxt7ot

Posted 2016-01-22T15:21:27.217

Reputation: 121

If its encrypted you would have to still provide some sort of passphrase, so the text value, could be read. Otherwise if that didn't happen anyone could still authenticate, as that user. – Ramhound – 2016-01-22T15:54:38.863

So one possible solution. Would be to mount a text file on an encrypted volume, load the text file from the configuration file (i.e. auth-user-pass password.txt which contains the username and password), which means if the volume was not mounted then another person wouldn't be able to log into the account. Most operating systems supported some FDE on volumes other then the system volume. – Ramhound – 2016-01-22T15:57:58.050

Answers

1

One can create a veracrypt container for login.conf only and manually mount that and then connect to the VPN. After the connection has been established you can dismount the container again.

Disadvantage:
You have to remount the container everytime the connection drops and you still have to enter a password at some point. However if you use just a keyfile instead of a password for that container and put it on a small USB device, that you keep away from people, you can setup automount for the container whenever you insert the USB device.

Advantage:
Nobody having unauthorized physical access to your computer can open the plain text file and write down or print out your password. At least not as easy as just having to do some few clicks.

Eisenhans

Posted 2016-01-22T15:21:27.217

Reputation: 11