assuming the list of users is in userlist (and that they are the same names as you want reset for smb) and that by reset, you mean to have no passwd reqmt during login, ie, no passwd reqd)
for user in `cat userlist` ; do
usermod -p "" $user
smbpasswd -n $user
done
note that the single quotes in the "for" clause is a single back quote, not the apostrophe to the right of the ";"
why would you want to do this? did you mean to remove the ability to login for users on the list? in that case, use passwd -l instead of usermod.
see man passwd, man smbpasswd, man usermod
Last edited by pen8wen; 04-22-2006 at 03:21 PM.
|