Comandos de la terminal/chage
Ir a la navegación
Ir a la búsqueda
chage
[rrc@Llawyr ~]$ su -
Password:
[root@Llawyr ~]# adduser Prueba
[root@Llawyr ~]# chage --help
Usage: chage [options] LOGIN
Options:
-d, --lastday LAST_DAY set date of last password change to LAST_DAY
-E, --expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
-h, --help display this help message and exit
-I, --inactive INACTIVE set password inactive after expiration
to INACTIVE
-l, --list show account aging information
-m, --mindays MIN_DAYS set minimum number of days before password
change to MIN_DAYS
-M, --maxdays MAX_DAYS set maximim number of days before password
change to MAX_DAYS
-R, --root CHROOT_DIR directory to chroot into
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS
[root@Llawyr ~]# rpm -qf $( which chage )
shadow-utils-4.1.5.1-6.mga4
[root@Llawyr ~]# chage -l Prueba
Last password change : May 09, 2014
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
Set Password Expiry Date for an user using chage option -M
[root@Llawyr ~]# chage -M 10 Prueba
[root@Llawyr ~]# chage -l Prueba
Last password change : May 09, 2014
Password expires : May 19, 2014
Password inactive : never
Account expires : never
Minimum number of days between password change : 0
Maximum number of days between password change : 10
Number of days of warning before password expires : 7
Set Account Expiry Date for an user using chage option -E
[root@Llawyr ~]# chage -E "2014-05-10" Prueba
[root@Llawyr ~]# chage -l Prueba
Last password change : May 09, 2014
Password expires : May 19, 2014
Password inactive : never
Account expires : May 10, 2014
Minimum number of days between password change : 0
Maximum number of days between password change : 10
Number of days of warning before password expires : 7
Set lockout after nn days of Inactivity for n user using chage option -I
[root@Llawyr ~]# chage -I 10 Prueba
[root@Llawyr ~]# chage -l Prueba
Last password change : May 09, 2014
Password expires : May 19, 2014
Password inactive : May 29, 2014
Account expires : May 10, 2014
Minimum number of days between password change : 0
Maximum number of days between password change : 10
Number of days of warning before password expires : 7
Minimum # days between Password change using -m
[root@Llawyr ~]# chage -m 5 Prueba
[root@Llawyr ~]# chage -l Prueba
Last password change : May 09, 2014
Password expires : May 19, 2014
Password inactive : May 29, 2014
Account expires : May 10, 2014
Minimum number of days between password change : 5
Maximum number of days between password change : 10
Number of days of warning before password expires : 7
[root@Llawyr usr]# chage Prueba
Changing the aging information for Prueba
Enter the new value, or press ENTER for the default
Minimum Password Age [5]:
Maximum Password Age [10]:
Last Password Change (YYYY-MM-DD) [2014-05-09]:
Password Expiration Warning [7]:
Password Inactive [10]:
Account Expiration Date (YYYY-MM-DD) [2014-05-10]:
Disable Password aging
[root@Llawyr ~]# chage -m 0 -M 99999 -I -1 -E -1 Prueba
[root@Llawyr ~]# chage -l Prueba
Last password change : May 09, 2014
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