Unlock User Account | CompTIA Linux+ Exam XK0-004 | Provider: CompTIA

Unlock User Account

Question

A user has been locked out of an account due to too many failed password attempts.

Which of the following commands will unlock the user's account?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

A.

https://www.tecmint.com/use-pam_tally2-to-lock-and-unlock-ssh-failed-login-attempts/

The correct answer is A. pam_tally2 --user=user --reset.

Explanation: When a user enters an incorrect password multiple times, their account may become locked as a security measure. To unlock the account, we need to use the appropriate command. Here's what each command does:

A. pam_tally2 --user=user --reset: This command resets the failed login count for a specified user (in this case, "user") back to 0, effectively unlocking the account. The "pam_tally2" module is used to keep track of failed login attempts.

B. passwd -u user -G root: This command is used to unlock a password-protected user account. The "-u" option unlocks the account and the "-G" option changes the user's primary group to "root".

C. usermod -u user -G root: This command is used to modify a user account. The "-u" option changes the UID (user ID) of the user, and the "-G" option changes the user's primary group to "root". However, this command does not unlock a locked account.

D. chage -1 user=user --reset: This command changes the password aging information for a user account. The "-1" option sets the password to never expire. The "--reset" option resets the number of days since the password was last changed. However, this command does not unlock a locked account.

Therefore, the correct answer is A. pam_tally2 --user=user --reset.