> Chris G Haravata wrote:
>
> how can i generate the password of all 1157 users in one sweep using
> their usernames as their initial passwords? i have no time to learn
> perl or somesuch languages. can u please help me? u have a script
> hidden somewhere maybe? please...
Old RedHat passwd programs had an undocumented -p option to set
passwords from a command line. Now you can use the --stdin option to
allow something like:
#!/bin/bash
for i in peter paul mary
do
echo $i|passwd --stdin $i
done
If your passwd doesn't have this "feature" you can use Perl or a system
programming language to modify the password file directly. In C you'd
use getpwent(3) and putpwent(3). Your other alternative is to use expect
to spawn passwd and fool it into thinking it's working on an interactive
terminal.
Brian
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
To subscribe to the Linux Newbies' List: send "subscribe" in the body to
[EMAIL PROTECTED]