in reply to How do I send a password to a command I start with Perl's Expect.pm

If you simply must keep passwords in sync by having the same passwd file, I highly recommend that you use rsync or scp instead.

Make one system be the authoritative source of the passwd file, and then have the other systems pull the file from there via cronjob. A certain place I worked did this for many thousands of machines with 99-point-many-nines-percent success. Every once in a while a particular machine would fail the pull; the retry next hour usually fixed it without any intervention.

Neither rsync nor scp will require the installation of anyting except for authorized keys so the password file can be copied without requiring the root password.

  • Comment on Re: How do I send a password to a command I start with Perl's Expect.pm

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:14 UTC
    We have a number of systems(redhat,hp-ux,aix,solaris) and for different customer we are using different centralize authentication system(MS-AD for redhat, YES we use MS, SunOne LDAP for our solaris) this system in question is HP-UX and they don't have a uniform user contents on /etc/passwd.
      Please don't tell me you use the same IDs and passwords at different customers. That's not at all safe. Does anyone other than yourselves have root (or admin privileges) on these machines? Consider the ramifications. Hacked copy of login, anyone?

      To be more direct: sharing passwords across customers could lead to a situation where one customer acquires access to a password belonging to the logins used by your company, giving them access to machines at your other customers, using an ID belong to your company. That would be a bad thing indeed. They might do anything; they could certainly masquerade as the user they got access to; if you use the same passwords internally too, then they could have access to YOUR machines. Consider getting a password manager for the machines at your company and using different passwords for every customer. Shared passwords used this way will sooner or later get you bitten.