Re: User creation script

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tim wrote:
On Wed, 2007-04-25 at 18:38 -0600, Ashley M. Kirchner wrote:
    Anyone have pointers (or examples) of a script that can be used to
create new users and set their password at the same time? I need something I can call like so:

    script USERNAME PASSWORD

...and have it return 1 or 0 for failure or success.

You can't use "useradd" as it already stands?


I think the problem is the password.
Splitting the script in to parts:

1. useradd   .... $1 .......
2. password --stdin <<"EOF"
$2
EOF

so if you call

script <USERNAME> "<PASSWORD>"

the password should be set correctly.

--
Joachim Backes <joachim.backes@xxxxxxxxxxxxxx>
University of Kaiserslautern,Computer Center [RHRK],
Systems and Operations, High Performance Computing,
D-67653 Kaiserslautern, PO Box 3049, Germany
--------------------------------------------------
Phone: +49-631-205-2438, FAX: +49-631-205-3056
http://hlrwm.rhrk.uni-kl.de/home/staff/backes.html

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux