nerdexam
Linux_Foundation

LFCA · Question #35

Which of the following commands can be used to lock a user's account so that they cannot log into a Linux server without removing any files, folders, or data?

The correct answer is B. usermod. The usermod command, when used with the -L option, can lock a user's account in Linux, preventing login without deleting any user files or data.

Submitted by zhang_li· May 4, 2026System Administration

Question

Which of the following commands can be used to lock a user's account so that they cannot log into a Linux server without removing any files, folders, or data?

Options

  • Alock
  • Busermod
  • Cuserdel
  • Dchmod

How the community answered

(52 responses)
  • B
    94% (49)
  • C
    4% (2)
  • D
    2% (1)

Why each option

The `usermod` command, when used with the `-L` option, can lock a user's account in Linux, preventing login without deleting any user files or data.

Alock

There is no standard `lock` command for user account locking in Linux.

BusermodCorrect

The `usermod` command is used to modify a user account, and when used with the `-L` (lock) option, it disables a user's password, effectively preventing them from logging in without removing their account data. This method preserves the user's home directory and files.

Cuserdel

The `userdel` command is used to delete a user account, which typically involves removing their home directory and data.

Dchmod

The `chmod` command is used to change file permissions, not to lock user accounts.

Concept tested: Linux user account management (locking)

Source: https://man7.org/linux/man-pages/man8/usermod.8.html

Topics

#User Management#Account Locking#usermod command

Community Discussion

No community discussion yet for this question.

Full LFCA Practice