If the requirement really is an arbitrary number of machines, the only way you can avoid keeping it in memory is to switch to a non-password based authentication. The program will need the password whenever it has to login so your options are really either to keep the password around or open all the connections up front (which doesn't work with an arbritrary number, but could be an option if your requirements are actually fewer machines). By opening all the connections up front you can then discard the password that was in memory (and hope none of the connections dies so you require it again). What you should really look at though is if there are alternative ways to accomplish the goal, things like ssh keys and kerberos can allow you to access machines without keeping passwords around.
| We're not surrounded, we're in a target-rich environment! |
|---|
In reply to Re: hiding passwords
by jasonk
in thread hiding passwords
by jfroebe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |