正確的停止Linux帳號的指令

根據http://unix.stackexchange.com/questions/7690/how-do-i-completely-disable-an-account 的描述:

The correct way according to usermod(8) is: usermod --lock --expiredate 1970-01-01 (Actually, the argument to --expiredate can be any date before the current date in the format YYYY-MM-DD.) Explanation: --lock locks the user's password. However, login by other methods (e.g. public key) is still possible. --expiredate YYYY-MM-DD disables the account at the specified date.

再根據底下的 comment 修改為:

usermod --lock --expiredate 1970-02-02 <username>

Comments