linux 禁用用户
Not yet to totally delete the Linux user account, but how to effectively disable a Linux user account?
尚未完全删除Linux用户帐户,但是如何有效地禁用Linux用户帐户?
That is, disable a user account while keep all its files/configurations. Later, if it is needed, so that I can enable it again.
即,禁用用户帐户,同时保留其所有文件 /配置。 以后,如果需要的话,我可以再次启用它。
To effectively disable a Linux user account so that it can’t login using its password or keys, you can use the usermod
tool:
要有效地禁用Linux用户帐户,使其无法使用其密码或密钥登录,可以使用usermod
工具 :
Lock a Linux user zma2
:
锁定Linux用户zma2
:
# usermod -e 0000-00-00 -L zma2
Unlock the user locked by the above one:
解锁被以上锁定的用户:
# usermod -e "" -U zma2
The -L
/-U
options lock/unlock the user’s password and -e
set/clear the expiration dates so that the user can/cannot login using other ways than the password.
-L
/ -U
选项锁定/解锁用户密码,并-e
设置/清除到期日期,以便用户可以/不能使用密码以外的其他方式登录。
翻译自: https://www.systutorials.com/how-to-effectively-disable-a-linux-user-account/
linux 禁用用户