Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have the following configured in /etc/network/interfaces:

 iface companyvpn inet manual
 openvpn company

This allows me to:

 ifup companyvpn

But unfortunately I am unable to provide my credentials as it appears to stop/place the process in the background?

 ifup companyvpn 
 Starting virtual private network daemon: companyEnter Auth Username:
 [1]+  Stopped                 ifup companyvpn

Any ideas how to allow the acceptance of username and password at the prompt?

share|improve this question

1 Answer 1

I resolved this issue by supplying my user credentials directly.

The line in /etc/openvpn/client.conf:

auth-user-pass /etc/openvpn/client.cred

The file takes the format of:

someusername
somepassword

Make sure you watch the file permissions though! 600 should be adequate.

Ran ifup and everything worked:

ifup companyvpn
Starting virtual private network daemon: company.
share|improve this answer
    
Just a side note, it seems there is no easy way to encrypt this auth file. Worth looking into though. –  Mash Oct 31 '12 at 15:18
    
I realize this is old, but the reason there isn't a way to encrypt it is because then you'd need to ask for a passphrase to decrypt it. Which wouldn't work. You can, of course, use full-disk encryption, then it will be encrypted. –  derobert Jun 5 at 17:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.