欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Linux chage命令詳解

 更新時間:2016年01月26日 15:12:40   投稿:mrr  
chage命令用于密碼實效管理,該是用來修改帳號和密碼的有效期限,接下來通過本文給大家介紹Linux chage命令相關(guān)知識,本文介紹的非常詳細,具有參考借鑒價值,感興趣的朋友一起學(xué)習(xí)吧

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

命令參數(shù):

參數(shù)

描敘

-d

指定密碼最后修改日期

-E

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

-h

顯示幫助信息并退出

-I

密碼過期后,鎖定賬號的天數(shù)

-l

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

-m

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

-M

密碼保持有效的最大天數(shù)。

-W

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

使用示例:

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:設(shè)置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

參數(shù):

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

相關(guān)文章

  • Linux sed命令的使用

    Linux sed命令的使用

    這篇文章主要介紹了Linux sed命令的使用,幫助大家更好的理解和學(xué)習(xí)Linux的使用,感興趣的朋友可以了解下
    2020-08-08
  • Linux 服務(wù)器同步 Rsync同步服務(wù)器文件

    Linux 服務(wù)器同步 Rsync同步服務(wù)器文件

    服務(wù)器之間常常要保持些文件或目錄的一致,比如一些大的軟件下載網(wǎng)站,它們通常使用多臺服 務(wù)器來提供下載服務(wù)。
    2009-08-08
  • Linux下SVN服務(wù)器自動更新文件到Web目錄的方法

    Linux下SVN服務(wù)器自動更新文件到Web目錄的方法

    這篇文章主要介紹了Linux下SVN服務(wù)器自動更新文件到Web目錄的方法,需要的朋友可以參考下
    2015-07-07
  • Centos6 網(wǎng)絡(luò)配置的實例詳解

    Centos6 網(wǎng)絡(luò)配置的實例詳解

    這篇文章主要介紹了Centos6 網(wǎng)絡(luò)配置的實例詳解的相關(guān)資料,希望通過本文大家能夠掌握配置網(wǎng)絡(luò)的知識,需要的朋友可以參考下
    2017-09-09
  • Apache簡介及安全配置方案

    Apache簡介及安全配置方案

    Apache HTTP Server(簡稱Apache)是Apache軟件基金會的一個開放源碼的網(wǎng)頁服務(wù)器,可以在大多數(shù)計算機操作系統(tǒng)中運行,由于其多平臺和安全性被廣泛使用,是最流行的Web服務(wù)器端軟件之一。它快速、可靠并且可通過簡單的API擴展,將Perl/Python等解釋器編譯到服務(wù)器中。
    2014-08-08
  • Linux中環(huán)境變量配置的步驟詳解

    Linux中環(huán)境變量配置的步驟詳解

    Linux中環(huán)境變量包括系統(tǒng)級和用戶級,系統(tǒng)級的環(huán)境變量是每個登錄到系統(tǒng)的用戶都要讀取的系統(tǒng)變量,而用戶級的環(huán)境變量則是該用戶使用系統(tǒng)時加載的環(huán)境變量。所以下面這篇文章主要給大家介紹了關(guān)于Linux中環(huán)境變量配置的相關(guān)資料,需要的朋友可以參考下。
    2017-07-07
  • Linux文件服務(wù)器實戰(zhàn)詳解(虛擬用戶)

    Linux文件服務(wù)器實戰(zhàn)詳解(虛擬用戶)

    這篇文章主要介紹了Linux文件服務(wù)器實戰(zhàn)詳解(虛擬用戶) ,需要的朋友可以參考下
    2018-06-06
  • 關(guān)于VPS內(nèi)存不足的一些說明和解決辦法

    關(guān)于VPS內(nèi)存不足的一些說明和解決辦法

    關(guān)于VPS內(nèi)存不足的一些說明和解決辦法,需要的朋友可以參考下。
    2011-11-11
  • linux環(huán)境中常用的mysql命令介紹

    linux環(huán)境中常用的mysql命令介紹

    大家好,本篇文章主要講的是linux環(huán)境中常用的mysql命令介紹,感興趣的同學(xué)趕快來看一看,對你有幫助的話記得收藏一下,方便下次瀏覽
    2021-11-11
  • Ubuntu 16.04無法切換root權(quán)限問題的解決

    Ubuntu 16.04無法切換root權(quán)限問題的解決

    root權(quán)限相信對大家來說都不陌生,下面這篇文章主要給大家介紹了關(guān)于Ubuntu 16.04無法切換root權(quán)限問題的解決方法,文中通過示例代碼介紹的非常詳細,需要的朋友可以參考借鑒,下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。
    2018-04-04

最新評論