Study for the TestOut Linux Pro Exam with our engaging quiz. Prepare using our flashcards and comprehensive multiple choice questions, each with hints and explanations to help you succeed. Get ready for your Linux certification today!

Practice this question and more.


How do you unlock a user account that has been locked?

  1. usermod -U username

  2. unlockuser username

  3. usermod -L username

  4. passwd -u username

The correct answer is: usermod -U username

The command to unlock a user account that has been locked is indeed "usermod -U username." This command uses the usermod utility, which is primarily designed for modifying user accounts on a Linux system. The "-U" option specifically stands for "unlock," allowing the administrator to remove the lock on the specified user account, thereby enabling the user to log in again. Other options present commands that serve different functions. "unlockuser username" is not a standard command in Linux for unlocking user accounts. The command "usermod -L username" would actually lock the account instead of unlocking it, as the "-L" option is used for that purpose. Lastly, the command "passwd -u username" is used to unlock a user account as well, but it is more specific to the password-related aspects of account management, as it unlocks a user’s password instead of addressing the account lock status comprehensively. Therefore, while "passwd -u" can be used in some contexts, "usermod -U" is the more universally applicable option for unlocking a locked account.