Find the answer to your Linux question:
Results 1 to 2 of 2

Thread: Passwords

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1


    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
    Täby, Sweden
    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:
    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):
    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