Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $YECBGYFECGEAFWHA as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2

Deprecated: imwpcache\f884414bce24ee67f\f73723ec7b1919fa5::__construct(): Implicitly marking parameter $BBWFDDBHHYHDXXAB as nullable is deprecated, the explicit nullable type must be used instead in /www/wwwroot/www.chuangxiangniao.com/wp-content/plugins/imwpcache-dist/build/f884414bce24ee67ff73723ec7b1919fa5.php on line 2
Linux中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

Android配合WebService访问远程数据库 中文WORD版 Android配合WebService访问远程数据库 中文WORD版

采用HttpClient向服务器端action请求数据,当然调用服务器端方法获取数据并不止这一种。WebService也可以为我们提供所需数据,那么什么是webService呢?,它是一种基于SAOP协议的远程调用标准,通过webservice可以将不同操作系统平台,不同语言,不同技术整合到一起。 实现Android与服务器端数据交互,我们在PC机器java客户端中,需要一些库,比如XFire,Axis2,CXF等等来支持访问WebService,但是这些库并不适合我们资源有限的android手机客户端,

Android配合WebService访问远程数据库 中文WORD版 0 查看详情 Android配合WebService访问远程数据库 中文WORD版

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

-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:密码过期前,开始警告天数

以上就是Linux中chage命令的语法是什么的详细内容,更多请关注创想鸟其它相关文章!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 chuangxiangniao@163.com 举报,一经查实,本站将立刻删除。
发布者:程序猿,转转请注明出处:https://www.chuangxiangniao.com/p/746892.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
Word标尺工具怎么调出来_Word显示或隐藏水平垂直标尺的方法
上一篇 2025年11月25日 18:09:31
win7操作系统中如何使用自带的录制功能进行录像
下一篇 2025年11月25日 18:09:32

相关推荐

发表回复

登录后才能评论
关注微信