当前位置:金沙js333娱乐场 > 网络频道 > Exadata的OS用戶密码过期

Exadata的OS用戶密码过期

文章作者:网络频道 上传时间:2019-10-19

发现Exadata上的OS用戶過期了,虽然知道Exadata上的OEL在用户密码上的要求进行了加强,但是發現OS用戶的密碼的有效期只有90天,這樣的話每90天就要修改一次密碼,太麻煩了,就都改成了不收限制:

linux chage命令简介:

查看用戶的密碼有效期:

chage命令用于密码实效管理,该是用来修改帐号和密码的有效期限。它可以修改账号和密码的有效期。对于chage命令的描述如下所示:

[root@dm01cel01 ~]# chage -l root

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

Last password change                                    : Aug 09, 2012

命令语法:

Password expires                                        : Nov 07, 2012

chage [options] user

Password inactive                                       : never

命令参数:

Account expires                                         : never

参数

描叙

-d

指定密码最后修改日期

-E

密码到期的日期,过了这天,此账号将不可用。0表示马上过期,-1表示永不过期。

-h

显示帮助信息并退出

-I

密码过期后,锁定账号的天数

-l

列出用户以及密码的有效期

-m

密码可以更改的最小天数。为零代表任何时候都可以更改密码。

-M

密码保持有效的最大天数。

-W

密码过期前,提前收到警告信息的天数。

Minimum number of days between password change          : 1

使用示例:

Maximum number of days between password change          : 90

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

Number of days of warning before password expires       : 7

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

[root@dm01cel01 ~]# chage -l celladmin

Options:

Last password change                                    : password must be changed

-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

Password expires                                        : never

2:查看mysql用户以及密码的有效期

Password inactive                                       : never

[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 ~]#

Account expires                                         : never

3:设置mysql用户60天后密码过期,至少7天后才能修改密码,密码过期前7天开始收到告警信息。

Minimum number of days between password change          : 1

[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

Maximum number of days between password change          : 90

4:强制新建用户第一次登陆时修改密码

Number of days of warning before password expires       : 7

[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

[root@dm01cel01 ~]# chage -l cellmonitor

下面给大家介绍linux chage命令

Last password change                                    : May 10, 2012

功能:修改帐号和密码的有效期限

Password expires                                        : Aug 08, 2012

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

Password inactive                                       : never

参数:

Account expires                                         : never

-l:列出用户的以及密码的有效期限
-m:修改密码的最小天数
-M:修改密码的最大天数
-I:密码过期后,锁定帐号的天数
-d:指定密码最后修改的日期
-E:有效期,0表示立即过期,-1表示永不过期
-W:密码过期前,开始警告天数

Minimum number of days between password change          : 1

Maximum number of days between password change          : 90

Number of days of warning before password expires       : 7

[root@dm01cel01 ~]# chage -l public

Last password change                                    : Aug 02, 2012

Password expires                                        : Oct 31, 2012

Password inactive                                       : never

Account expires                                         : never

Minimum number of days between password change          : 1

Maximum number of days between password change          : 90

Number of days of warning before password expires       : 7

[root@dm01cel01 ~]#

注:上面的celladmin用戶的Password expirs顯示為never,並不是說該用戶的用戶密碼永不過期,而是因為該用戶的密碼已經過期了Password must be changed

 

修改,99999表示永不過期Never:

chage -M 99999 root

本文由金沙js333娱乐场发布于网络频道,转载请注明出处:Exadata的OS用戶密码过期

关键词: