Guest User

Untitled

a guest
May 2nd, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # to set passwords in a username and password file
  4. # Each $line is "username"
  5. # passwords are generated and added as second variable in csv file
  6.  
  7. # Path to the file with users that need passwords
  8. Users="/Users/rzm102/Desktop/users.txt"
  9. # Path to the file with users and generated passwords
  10. UsersAndPasswords="/Users/rzm102/Desktop/userspass.txt"
  11.  
  12. while read line
  13. do
  14. new_password=`openssl rand -base64 6`
  15. #/usr/bin/dscl -u diradmin -p password /LDAPv3/127.0.0.1 -passwd /Users/"$line $new_password"
  16. echo "$line, $new_password" >> "$UsersAndPasswords"
  17. done < "$Users"
Advertisement
Add Comment
Please, Sign In to add comment