In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to use the chage command in Linux. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.
Linux common command chage for password effectiveness management, this is used to modify the account and password validity period
chage Change the validity period of your account and password
Syntax chage [option] User name option-m: Minimum number of days a password can be changed. A value of zero means you can change your password at any time. -M: Maximum number of days the password remains valid. -w: The number of days before the user password expires, the warning message is received in advance. -E: Date the account expires. After this date, this account will not be available. -d: Date of last change. -i: period of stagnation. If a password expires these days, the account will not be available. -l: Example current settings. It is up to non-privileged users to determine when their password or account expires. For instance, you can edit/etc/login.defs to set several parameters. The password will be set according to the parameters by default:
PASS_MAX_DAYS 99999 PASS_MIN_DAYS 0 PASS_MIN_LEN 5 PASS_WARN_AGE 7 Of course, in/etc/default/useradd, you can find the following two parameters to set:
# useradd defaults file GROUP=100 HOME=/home INACTIVE=-1 EXPIRE= SHELL=/bin/bash SKEL=/etc/skel CREATE_MAIL_SPOL =yes By modifying the configuration file, it can work on new users later, while users who already exist in the current system are directly configured with chage.
My server root account password policy information is as follows:
[root@linuxde ~]# chage -l root Last password modified : March 12, 2013 Password expiration time : Never password expiration time : Never account expiration time Minimum number of days between never changing passwords twice : 0 Maximum number of days between password changes : 99999 Number of days to warn before password expires : 7 I can change my password expiration time by:
[root@linuxde ~]# chage -M 60 root [root@linuxde ~]# chage -l root Last password modified : March 12, 2013 Password expiration time : May 11, 2013 Password expiration date : Never account expiration time Minimum number of days between never changing passwords twice : 0 Maximum number of days between password changes : 60 Number of days to warn before password expires : 9 Then set the password expiration time by:
[root@linuxde ~]# chage -I 5 root [root@linuxde ~]# chage -l root Last password modified : March 12, 2013 Password expiration time : May 11, 2013 Password expiration date : May 16, 2013 Account expiration time Minimum number of days between never changing passwords twice : 0 Maximum number of days between password changes : 60 Number of days to warn before password expires : 9 From the above command, you can see that 5 days after the password expires, the password will automatically expire, and the user will not be able to log in to the system.
Thank you for reading! About "how to use chage command in Linux" this article is shared here, I hope the above content can have some help for everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.