Hi all
I want to put expire time to my whole users to change their password by their own by the date which i put (For example every 1st of the month).How can i set the users like this?
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.
Hi d3funct
Thank you for your help
That script exactly what i want but unfortunetely i have no those options are.Maybe i need to change my security type,do you know how can i find out what is my current security type.?And how to change it to enchanged
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.