Batch mode for adduser

Nils Philippsen nphilipp at redhat.com
Sat Jul 26 12:07:12 UTC 2003


On Fri, 2003-07-25 at 20:36, Ethan Bonick wrote:
> I would like to request a newusers like program that will take plain text
> passwords and encrypt them so the program could be useful. Newusers
> leavesthe password in plaintext which is not secure at all.

Hmm, here newusers crypt()s the password, but doesn't make an MD5 hash
out of it.

> I have created a script that does this same kind of function but it
> only works on RedHat because other distro's dont compile with the same
> options. Check it out on www.networkinggeeks.com/scripts.html If
> anyone knows how to rewrite newusers to crypt the password it would be
> a wonderful addition. In my Linux classes we went over the newusers
> command but deemd it useless because it wont crypt the passwords. Does
> anyone else feel this would be a very useful utility?

I usually use a shell script that takes a similar file like newusers
which eventually runs groupadd, then useradd and finally runs passwd 
like this to set the password:

[...]
(echo $newpasswd; echo $newpasswd) | passwd $newuser
[...]

This works here (also a Red Hat system) but should work anywhere where
useradd/groupadd exist/work.

Nils
-- 
     Nils Philippsen    /    Red Hat    /    nphilipp at redhat.com
"They that can give up essential liberty to obtain a little temporary
 safety deserve neither liberty nor safety."     -- B. Franklin, 1759
 PGP fingerprint:  C4A8 9474 5C4C ADE3 2B8F  656D 47D8 9B65 6951 3011
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-test-list/attachments/20030726/fd06d67e/attachment.sig>


More information about the fedora-test-list mailing list