Утилита passwd, кроме смены пароля, позволяет управлять парольной политикой в ОС.
Выведем текущую парольную политику для пользователя noc1 в Linux.
# passwd -S noc1 noc1 P 2012-07-09 0 99999 7 -1 (Пароль задан, шифр SHA512.)
Где ключ -S позволяет вывести
-S, --status
Display account status information. The status information consists of 7 fields. The first field is the user´s login name. The second field indicates if the user account is locked (L), has no password (NP), or has a usable password (P). The third field gives the date of the last password change. The next four fields are the minimum age, maximum age, warning period, and inactivity period for the password. These ages are expressed in days
# passwd -x 90 -w 3 -i 1 username # passwd -S username username P 2012-07-09 0 90 3 1 (Пароль задан, шифр SHA512.)
Ключи команды passwd обозначают следующее, и доступны только от имени root.
Команда приведенная в листинге ограничивает срок действия пароля 3 месяцами с выдачей предупреждения за 3 дня до окончания срока действия пароля. По истечения срока действия пароля пользователю будет предложено сменить пароль.