[SUMMARY] Changing password via script

From: David M. Arroyo Diaz (david.arroyo_at_corp.ya.com)
Date: 01/21/04

  • Next message: Tony van Lingen: "SUMMARY: Multiple /opt's"
    To: <sunmanagers@sunmanagers.org>
    Date: Wed, 21 Jan 2004 15:12:45 +0100
    
    

    Hello everyone,

    I've received a couple of answers. Thanks to everyone who gave a hint about
    this.

    The question was: How can I change via script or similar the password for
    hundred of users without having to type it manually?

    The general consensus was to use "expect" in order to feed the standard
    "passwd" program. Other suggested to play with awk, sed or other utilities
    in order to change "/etc/shadow" as needed.

    As an example, here is a little piece of expect code that Mike Mann sent to
    me:

    --------------------------------------------------------------
        spawn passwd david
        expect "New Password: "
        send "secret\r"
        expect "Re-enter new Password: "
        send "secret\r"
        expect "passwd: password successfully changed for david"
    --------------------------------------------------------------

    Thanks to everyone for your help.

    Regards,
    David Arroyo
    _______________________________________________
    sunmanagers mailing list
    sunmanagers@sunmanagers.org
    http://www.sunmanagers.org/mailman/listinfo/sunmanagers


  • Next message: Tony van Lingen: "SUMMARY: Multiple /opt's"

    Relevant Pages

    • Quest for HEX Strings
      ... maybe somebody can give me a hint how to solve this Problem. ... write a script that can recover files from malformed Mails. ... Now I want to create a script wre I can automate this task. ... will place all the Header to an Array and than I want to grep for them ...
      (de.comp.lang.perl.misc)
    • Re: Debian MySQL Perl DBI - connection terminates unexpectedly after 100 secs.
      ... I rather guess it was a gentle hint that your problem description ... to catch e.g. script that run in an endless loop. ... If you are using Apache it might be a RLimitCPU ... files of the web server will give you some more hints. ...
      (comp.lang.perl.misc)
    • Re: Execution Plan Hinting
      ... someone a hint at what is going wrong. ... I couldn't recreate your problem running this script from Query Analyzer. ... PRIMARY KEY constraint 'PK_FIELD_VALUES'. ...
      (comp.databases.ms-sqlserver)
    • Re: Debian MySQL Perl DBI - connection terminates unexpectedly after 100 secs.
      ... Or am I running out of memory. ... I rather guess it was a gentle hint that your problem description ... to catch e.g. script that run in an endless loop. ... If you are using Apache it might be a RLimitCPU ...
      (comp.lang.perl.misc)
    • Re: Debian MySQL Perl DBI - connection terminates unexpectedly after 100 secs.
      ... Or am I running out of memory. ... I rather guess it was a gentle hint that your problem description ... to catch e.g. script that run in an endless loop. ... If you are using Apache it might be a RLimitCPU ...
      (comp.lang.perl.misc)