Simon Bryan wrote:
>
> HI,
> I have a script I downloaded and have been able to make a couple of mods
> to. The script is called Addpopusers and takes input from a text file and
> creates the users for me. However now I do not want to create passwords as
> the system will authenticate against an NT server using PAM. The users are
> needed to allow for email from within AUC. Can someone look at the code
> below and tell me how to modify this to prevent the creation of a password
> for each user. My alternative is to let it create identical passwords and
> then use an editor to edit 'shadow'. BTW $passplain is set in a preceding
> section of the script, could I just set that to ""?
OK, but depending on how you have your PAM set up, you may want / need to
have passwords in the /etc/passwd or /etc/shadow files. This is a "fallback"
password that the user can log in with if the NT domain controller is not
responding.
Normally, I set this to something useful for the root user, and useless for
other users (I use an LDAP server, not an NT server, but the concept is
the same).
> `useradd -m -d "$homebase$loginname" -c "$name,,,$comment" -g
> "$Group" -s "$ushell" -k "/etc/skeleton" -e "$acct_expire" -p $passwd -O
> UID_MIN=$uid_min -O UID_MAX=$uid_max -O GID_MIN=$gid_min -O
> GID_MAX=$gid_max $loginname >./user.exists 2>&1`
Just before this line, set $passwd to something random. eg:
passwd=`echo $$` (really simple case), or
passwd="AnyStRiNg$$and`date '+%s'`" or
# do something clever with a random number generator.
Del
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug