国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 服務器 > Linux服務器 > 正文

Linux chage命令詳解

2024-09-05 23:02:29
字體:
來源:轉載
供稿:網友
chage命令用于密碼實效管理,該是用來修改帳號和密碼的有效期限,接下來通過本文給大家介紹Linux chage命令相關知識,本文介紹的非常詳細,具有參考借鑒價值,感興趣的朋友一起學習吧
 

linux chage命令簡介:

chage命令用于密碼實效管理,該是用來修改帳號和密碼的有效期限。它可以修改賬號和密碼的有效期。對于chage命令的描述如下所示:

The chage command changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change his/her password

命令語法:

chage [options] user

命令參數:

 

參數

描敘

-d

指定密碼最后修改日期

-E

密碼到期的日期,過了這天,此賬號將不可用。0表示馬上過期,-1表示永不過期。

-h

顯示幫助信息并退出

-I

密碼過期后,鎖定賬號的天數

-l

列出用戶以及密碼的有效期

-m

密碼可以更改的最小天數。為零代表任何時候都可以更改密碼。

-M

密碼保持有效的最大天數。

-W

密碼過期前,提前收到警告信息的天數。

 

使用示例:

1: 查看chage命令的幫助信息

[root@DB-Server ~]#man chage
[root@DB-Server ~]# info chage
[root@DB-Server ~]# chage -h
Usage: chage [options] user

Options:

-d, --lastday LAST_DAY set 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
-W, --warndays WARN_DAYS set expiration warning days to WARN_DAYS

2:查看mysql用戶以及密碼的有效期

[root@DB-Server ~]# chage -l mysql
Last password change : Mar 26, 2015
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : -1
Maximum number of days between password change : -1
Number of days of warning before password expires : -1
[root@DB-Server ~]#

3:設置mysql用戶60天后密碼過期,至少7天后才能修改密碼,密碼過期前7天開始收到告警信息。

[root@DB-Server ~]# chage -M 60 -m 7 -W 7 mysql
You have new mail in /var/spool/mail/root
[root@DB-Server ~]# chage -l mysql
Last password change : Mar 26, 2015
Password expires : May 25, 2015
Password inactive : never
Account expires : never
Minimum number of days between password change : 7
Maximum number of days between password change : 60
Number of days of warning before password expires : 7
[root@DB-Server ~]#
clip_image001

4:強制新建用戶第一次登陸時修改密碼

[root@DB-Server home]# useradd test
[root@DB-Server home]# passwd test
Changing password for user test.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@DB-Server home]# chage -d 0 test
You have new mail in /var/spool/mail/root
[root@DB-Server home]# chage -l test
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

下面給大家介紹linux chage命令

功能:修改帳號和密碼的有效期限

用法:chage[-l][-m mindays][-M maxdays][-I inactive][-E expiredate][-W warndays][-d lastdays]username

參數:

-l:列出用戶的以及密碼的有效期限
-m:修改密碼的最小天數
-M:修改密碼的最大天數
-I:密碼過期后,鎖定帳號的天數
-d:指定密碼最后修改的日期
-E:有效期,0表示立即過期,-1表示永不過期
-W:密碼過期前,開始警告天數



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 龙门县| 嘉峪关市| 中牟县| 桃园县| 谷城县| 济南市| 大足县| 图们市| 武威市| 上栗县| 馆陶县| 醴陵市| 浪卡子县| 枞阳县| 鲜城| 华亭县| 巴东县| 柘城县| 仪征市| 桐乡市| 易门县| 眉山市| 庆安县| 通江县| 桃江县| 徐汇区| 讷河市| 兴国县| 武汉市| 连南| 鲁甸县| 新宾| 通海县| 乐陵市| 赤峰市| 溆浦县| 敦煌市| 偃师市| 龙海市| 留坝县| 固安县|