Tampio
November 6th, 2007, 11:24 AM
I have this script that connect's to an ftp server, download's my irc logs, then generates statistics of the channel with pisg and uploads those to another ftp server. It works fine, but it leaves my passwords visible. If I give them as command line arguments they're left in the .bash_history, and the problem is that they're written in there only after I close the terminal window, so I can't add a part to the script that would get rid of them.
The ideal way for me would be to give the passwords when the server asks for them, so they are not visible at any point. But if I make the code like this:
echo "user $username" | ftp -n -v $server
it connects and asks for password, but right after I've typed it in the connection closes and I can't do anything.
Any way I could have the connection not close after typing the password, or if I give them as command line arguments could I have that line somehow not be written in the .bash_history? Or maybe there's some other nifty method I haven't thought of.
The ideal way for me would be to give the passwords when the server asks for them, so they are not visible at any point. But if I make the code like this:
echo "user $username" | ftp -n -v $server
it connects and asks for password, but right after I've typed it in the connection closes and I can't do anything.
Any way I could have the connection not close after typing the password, or if I give them as command line arguments could I have that line somehow not be written in the .bash_history? Or maybe there's some other nifty method I haven't thought of.