to start with you might want to set their usernames to their passwds (uh!) "cat users.csv | tr "," "\n" | xargs -i setpasswd {}" where the script setpasswd = "printf "$1\n" | passwd --stdin -f $1"
Tried this but it generates an error "passwd: invalid option -- -" I've tried adjusting various bits without success which isn't suprising
i think that there is a good way to set passwds using the mkpasswd program. i had forgotten about it when i first posted. sorry! try this cat users.csv | tr "," "\n" | xargs -i /usr/bin/mkpasswd {} | tr "\n" "," > passwords this will set a good password for each user in the csv file. each password will be stored in a file named passwords. each password in the list represents the password for the respective user in the users.csv file. i'm sure that u can merge the file nicely so that you have a good record of all passwords. i would think a perl script might be best for this merging. e.g. #!/usr/bin/perl open USERS, "users.csv"; open PASSWDS, "passwords"; open MERGED, ">userandpass"; $/ = ","; while ($userid = <USERS>) { chomp $userid; print MERGED "$userid => "; $passwd = <PASSWDS>; chomp $passwd; print MERGED "$passwd\n"; } close USERS; close PASSWDS; close MERGED;