msgbartop
A cronological documentation test project, nothing serious, really!
msgbarbottom

04 Sep 07 Mass setting user passwords

Posted by

Every need to change (or set) passwords for a large number of users? Something like this code snippet may help.

# find all the usernames with bash logins
usernames=$(cat /etc/passwd  | grep bash | sed 's/:.*//g)
for i in $usernames; do
    echo "somepassword" | passwd --stdin $i
done

Tags:

Leave a Comment

You must be logged in to post a comment.