in reply to How do I send a password to a command I start with Perl's Expect.pm
It would be far better to take a different approach to handling your passwords!
First of all, you never want a script to be able to log-on to anything as root.
while (1) { print "never! "; }
Secondly, if you need to maintain consistent passwords across a large number of systems, “the right way to do it” (IMHO...) is to use LDAP authentication. Instead of consulting a local password-file, your system issues a secure LDAP query to a central server. (Yes, I am drawing a simplified picture.) Now you can manage all of your authentication and authorization tasks, across systems of all types, from one central location. Most major subsystems are already aware of it. Apache, for example, provides mod_ldap. I really don’t think that I am wrong to say, “this is how it’s done in the real world; go thou and do likewise.”
(Incidentally, Microsoft calls the same technology Active Directory.™)
Linux systems have a very nice facility known as PAM (Pluggable Authentication Modules) which provides a very flexible interface foundation. There are drop-in authentication modules which consult LDAP.
(Please note also that there are competing technologies, such as Kerberos, which perform a comparable function. The essential idea for our purposes is the same.)
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I send a password to a command I start with Perl's Expect.pm
by Anonymous Monk on Oct 23, 2010 at 02:08 UTC | |
|
Re^2: How do I send a password to a command I start with Perl's Expect.pm
by Anonymous Monk on Oct 23, 2010 at 02:12 UTC |