Services and User Management
A contractor's engagement has ended. The contractor logs in over SSH with a public key. An administrator must block every login method for the account right away, while keeping the home directory and the account itself. Which command meets this requirement?
Show the answer
Correct answerA. chage -E 0 contractor
chage -E 0 sets the account expiration date to 1970-01-01, so the account is rejected for all authentication methods, including SSH keys. passwd -l and usermod -L only prefix the password hash with '!', which blocks password logins but usually still permits key-based SSH.