LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to redirect txt file to password input? (https://www.linuxquestions.org/questions/linux-general-1/how-to-redirect-txt-file-to-password-input-429884/)

saravkrish 03-30-2006 12:33 AM

How to redirect txt file to password input?
 
Hi,

I'm using vpnc to log on to my office.

I want to use zenity to get the password input thru a GUI textbox and then pass it on to vpnc.

vpnc < password.txt

doesn't work. How do I get this to work? Or is there someother GUI interface for VPNC in Fedora?

Thanks,
Sarav

acid_kewpie 03-31-2006 12:19 PM

there is actually a Network-Manager module for vpnc but it's pretty unstable, and.. crap in my experience. if you want to wrap vpnc this much, then just use an expect script. as you will see from the documentation, vpnc will deliberatley not accept a password from a command line, it must be in a configuration file, or manually typed in. Expect can automate this manual entry exeternal to the program. I'd say that this was insecure as you would be holding a plaintext password in your script, but in reality it's better than a fixed config file which contains a plaintext string anyway!

saravkrish 03-31-2006 08:40 PM

Hi,

Thanks for the reply. I will check out expect. I know it would be insecure, but I will be writing the password to a file, redirecting it and then delete it. I know it will still be accessible thru a raw read, but it's much better than a file that stays all the time.

Thanks,
Sarav

acid_kewpie 04-01-2006 02:23 AM

well if you are using expect then there is no need for an temporary file, it can directly read the "Password: " prompt that vpnc provides.


All times are GMT -5. The time now is 11:41 AM.