nerdexam
CompTIA

LX0-104 · Question #518

Of the ways listed, which is the best method to temporarily suspend a user's ability to interactively login?

The correct answer is B. Use chage to expire the user account.. To temporarily prevent a user from logging in interactively, the best method is to use the chage command to set an expiration date for their account.

Administrative Tasks

Question

Of the ways listed, which is the best method to temporarily suspend a user's ability to interactively login?

Options

  • AUse passwd -d username to give the user an empty password.
  • BUse chage to expire the user account.
  • CChange the user's password.
  • DAdd the command exit to the user's .login file.

How the community answered

(33 responses)
  • A
    15% (5)
  • B
    73% (24)
  • C
    9% (3)
  • D
    3% (1)

Why each option

To temporarily prevent a user from logging in interactively, the best method is to use the `chage` command to set an expiration date for their account.

AUse passwd -d username to give the user an empty password.

Using `passwd -d username` removes the user's password, which prevents password-based login but does not explicitly suspend the account and might not be suitable for temporary measures.

BUse chage to expire the user account.Correct

The `chage` command (change user password expiry information) allows an administrator to set an account expiration date, effectively disabling the user account from logging in until the expiration date is removed or modified. This provides a temporary and reversible suspension of login privileges without altering the user's password or home directory configuration.

CChange the user's password.

Changing the user's password prevents the user from logging in with their old password but does not suspend the account itself; a new password could be provided, or other authentication methods might still work.

DAdd the command exit to the user's .login file.

Adding `exit` to a user's .login file (or similar shell configuration) is a workaround that depends on the shell and login method, and it is not a standard or robust way to temporarily disable an account at the system level.

Concept tested: Linux user account management, temporary suspension

Source: https://man7.org/linux/man-pages/man1/chage.1.html

Topics

#user account suspension#chage command#account expiry#user management

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice