Which command is used to lock a user's account in Linux?

  • passwd -l
  • usermod -L
  • lockuser -u
  • userlock -a
The correct command to lock a user's account in Linux is passwd -l. This command will place an "!" in front of the user's password hash in the /etc/shadow file, preventing them from logging in. It's a security measure to temporarily or permanently disable a user's account.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *