Find the answer to your Linux question:
Results 1 to 2 of 2
Is there a way I can change a series of user accounts to the same password? For example if I have user1-50 accounts setup and I want them all to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2003
    Posts
    56

    Passwords


    Is there a way I can change a series of user accounts to the same password? For example if I have user1-50 accounts setup and I want them all to have the password "linux"? or not have them need a password at all Thanks

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    First you need to contruct a list of user names. Say, for example, that you put the user names in /tmp/users. Then run this:
    Code:
    for user in `cat /tmp/users`; do passwd --stdin $user <<<linux; done
    The user list could be contructed, for example, like this (modify to your needs):
    Code:
    awk -F &#58; '&#123;if&#40;$3 >= 500&#41; print&#40;$1&#41;;&#125;' </etc/passwd | egrep 'Some Pattern' >/tmp/users

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •