In trying to get together a disaster recovery plan a good friend of mine 
Richard Rager wrote this script for me:

#!/bin/sh
# echo test
for a in `cat users.txt`
do
{
u=(`echo $a | cut -f 1 -d ':'`);
p=(`echo $a | cut -f 2 -d ':'`);
echo "User    : "$u
echo "Password: "$p
adduser -s "/bin/false" $u
echo "$u:$p" | chpasswd
}
done

the users.txt file would look like this:

username:password
jim:jim431
joe:joe'spassword

After executing this script i was curious as to why when i tried to login as 
joe his password did not work. First thoughts were it was the weird chars in 
his password that were throwing chpasswd off, perhaps thinking it was being 
told to do something, specialy if a password would contain a & or something.
After pulling out a few hairs i bumped into the problem.
chpasswd is only allowing the first 8 chars. If i try to log in joe with a 
password of joe'spas it works fine.

SO, the question is. Is this a major bug or what? I am using MD5 and assumed 
i could use all 32 of the bytes allowed, however using that script with 
chpasswd i can not.

Someone told me about the newusers command and i will be looking into it. If 
someone can send me a example file that adds a new user with 
username,password and what shell to give them only i would greatly appreciate!
Also, does anyone know if newusers has the same problem chpasswd has?

Thanks...

Jim.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to