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.
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)- B94% (49)
- C4% (2)
- D2% (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.
There is no standard `lock` command for user account locking in Linux.
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.
The `userdel` command is used to delete a user account, which typically involves removing their home directory and data.
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
Community Discussion
No community discussion yet for this question.