FastNetMon

Showing posts with label PAM. Show all posts
Showing posts with label PAM. Show all posts

Monday, 5 April 2010

Как заставить пользователя сменить пароль при первом логине?

Создаем пользователя:
useradd nrg -m


Проэкспайриваем ему пароль:

chage -d 0 nrg


Проверяем статус пароля:
chage nrg --list
Last password change : password must be changed
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7


Теперь при следующем логине пользователь будет обязан сменить пароль на новый:

You are required to change your password immediately (root enforced)
WARNING: Your password has expired.
You must change your password now and login again!
Changing password for user nrg.
Changing password for nrg
(current) UNIX password:


И после смены пароля его статус изменится:
chage nrg --list
Last password change : Apr 06, 2010
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 99999
Number of days of warning before password expires : 7


источник: http://www.thegeekstuff.com/2009/04/chage-linux-password-expiration-and-aging/