Linux服务器上的非过期密码


12

我想在Linux服务器上设置一个帐户,并使该帐户的密码永不过期。我很难在passwd手册页中找到答案。有人可以帮我吗?

Answers:


21

要最大程度地延长密码有效期:

passwd -x 99999 username

要禁用帐户到期:

usermod -e '' username

要同时进行更改:

chage -E -1 -M -1 username

要设置系统默认值,请查看/ etc / default / useradd





0

减轻所有其他先前配置的完整命令如下:

chage -E -1 -M -1 -I -1 username

0

AIX:密码未过期

更改用户历史记录大小

chuser histsize=0 <userid>

更改用户密码

passwd <userid>

清除标志,通知操作系统在登录时重置密码(重置密码后)

pwdadm -c <userid>

如果不想通过编辑用户历史记录大小来引起麻烦,可以使用以下命令更改安全文件,说最后一次重置密码始终是今天。您可以将其导出到.profile文件中,以便每次登录时也可以运行。

chsec -f /etc/security/passwd -s <userid> -a lastupdate=`date +%s`

0

这是有关Linux到期密码的chage命令(更改年龄)的完整示例:完全禁用密码到期和帐户:

参数命令修改:

-m 0 : Minimum number of days for the password change.
-M 99999 : Maximum number of days a password change.
-I -1 : We set: "Password inactive" never.
-E -1 : We set: "Expires Account" never.

示例用户名是:sysadmit

[root@linux1~] # chage -m 0 -M 99999 -I -1 -1 -E sysadmit

[root@linux1~] # chage --list sysadmit
Last password change: July 15, 2017 
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 Expires password 7 

摘自:http : //www.sysadmit.com/2017/11/linux-caducidad-contrasena.html

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.