Linux 锁定系统帐号


在 Linux 下有时需要将系统帐号 lock 起,这个动作可以用 passwd 指令完成,只要在 passwd 指令后面加上 -l 参数便可以,而这个参数只可以用 root 身份执行,语法是:

# passwd -l username

如果帐号已经 lock 住,想登入的话会出现 “This account is currently not available.”:

# su – username
This account is currently not available.

要将 lock 起的帐号 unlock, 做法是在 passwd 指令加上 -u 参数:

# passwd -u username

Leave a Reply