henrydenhengst

Create Users And Change Passwords

Oct 22nd, 2015
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.31 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # First create a file which contains all the usernames, name 'userlist.txt'. Something like this (without the #):
  4. # henry
  5. # ilona
  6. # danielle
  7. # denzel
  8. #
  9. #!/bin/bash
  10. password="123456"
  11. for USER in $(cat userlist.txt)
  12. do
  13.     useradd -m $USER
  14.     echo -e "${password}\n${password}" | passwd $USER
  15. done
Add Comment
Please, Sign In to add comment