Shell script

Jason Clinton me at jasonclinton.com
Wed Nov 12 19:20:38 CST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

brad wrote:

| This words great for useradd, but how then would you set the password
| for each user?
|

If you have chpasswd on your system, you could use a variation on the solution I
posted last night. If you don't have Ruby, you could modify the Perl script from
Garret:

(I know nothing about Perl, so this is only a guess)

perl -lnae 'print $F[0]+":"+$F[1]+"n"' filename | chpasswd

This would, I assume, concantenate the two columns together with a dividing ":"
followed by a newline character and then pipe that to the chpasswd command which
accepts piped data. The password can be either the shadow mask or if you add the
- -e it should be in plain text format.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Understand the importance of encryption:

iD8DBQE/snn0tSqjk42zvwkRAiuEAKCfzmdLplbvshkthhURMJYRy3XjtgCdGvDt
QNBqTZNMXFh3/34wGV6H/+0=
=L99I
-----END PGP SIGNATURE-----




More information about the Kclug mailing list