Linux 安全技术全面解析
1. 账户密码设置
在 Linux 系统中,账户的密码设置至关重要。以 tim 账户为例,我们可以使用 chage -l 命令查看其密码设置信息:
# chage -l tim | grep Password
Password expires : never
Password inactive : never
从输出结果可知, tim 账户的密码没有设置过期和停用时间。若仅使用 -I 选项尝试设置密码过期后账户锁定时间,如:
# chage -I 5 tim
# chage -l tim | grep Password
Password expires : never
Password inactive : never
可以发现设置并未生效。因为若未设置密码过期时间, -I 选项将不起作用。所以,需要使用 -M 选项设置密码的最大使用天数,从而使密码停用时间设置生效:
# chage -M 30 -I 5 tim
# chage -l tim | grep Password
Passwo
订阅专栏 解锁全文
533



被折叠的 条评论
为什么被折叠?



