Linux command
lchage 命令
安全
权限或系统影响较大,执行前请核对目标。
常用示例
Example
sudo lchage --list [username]
Disable
sudo lchage --date -1 [username]
Example
sudo lchage --mindays [days] [username]
Example
sudo lchage --maxdays [days] [username]
Example
sudo lchage --warndays [days] [username]
说明
lchage displays or changes user password expiration policy on systems using libuser. It provides similar functionality to chage but uses the libuser library for user database access.
参数
- -l, --list
- Display password aging information for the user
- -d, --date DAYS
- Set last password change date (-1 to disable expiration)
- -m, --mindays DAYS
- Minimum days between password changes
- -M, --maxdays DAYS
- Maximum days before password change required
- -W, --warndays DAYS
- Days to warn before password expires
- -I, --inactive DAYS
- Days after expiry before account is disabled
- -E, --expiredate DATE
- Set account expiration date
FAQ
What is the lchage command used for?
lchage displays or changes user password expiration policy on systems using libuser. It provides similar functionality to chage but uses the libuser library for user database access.
How do I run a basic lchage example?
Run `sudo lchage --list [username]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -l, --list do in lchage?
Display password aging information for the user