Hi,
passwd -d -n 0 -w 7 -x 90 $username; passwd -f $username. Will set the users password to expire 90 days from the date the command is run (e.g., today), 7 days before it will warn them that they have 7 days to change the password, the "-n 0" flag says that the minimum expiration date is 0 and the user will have to change the password at the next login after you'v issued the "passwd -f" to force the change. I tried using the -f and -d flag at the same time but it locked the users account each time, so now I do them seperately. Also, on a security conscious note, if you issue the force and the user doesn't already have a password assigned there will be no password until the user logs in, so I would do something like this (scriptwise) :
print -n 'username? ' #sets the $username
read username
passwd -d -n 0 -w 7 -x 90 $username
sleep 3
passwd $username
sleep 3
passwd -f $username
This script will prompt you for the username (to set the variable), then set the 90 day expiration with immediate change upon next login, ask you to set an initial password (for security purposes it's best) and then set the flag to force the user to change the password.
Hope this helps B-) d3funct
vanya43@yahoo.com
The software required `Windows 95 or better', so I installed Linux.