102-500 practice question 27 of 30
Of the ways listed, which is the best method to temporarily suspend a user's ability to interactively login?
Full set: 233 questionsThe best method among the choices to temporarily suspend a user's interactive login is to expire the account. Using chage -E YYYY-MM-DD username to set the account expiration date to a date in the past (e.g., 1970-01-01 or simply 0) immediately blocks logins. This is a standard, effective, and easily reversible administrative action. To re-enable the account, the administrator can simply set a future expiration date or remove it entirely (chage -E -1). This is superior to manipulating passwords or shell startup files.
A: Using passwd -d deletes the password, which may allow passwordless login depending on system configuration, making the system less secure. C: Changing the user's password is a valid but less clean method, as it requires the administrator to manage the new password and restore the old one. D: Adding exit to .login is unreliable. It only affects certain shells, does not prevent non-interactive sessions (like scp), and can be bypassed.
1. chage(1) Linux manual page. The description for the -E, --expiredate option states it is used to "Set the date on which the user account will no longer be accessible."
2. Red Hat Enterprise Linux 8 Documentation, "Configuring basic system settings", Chapter 10, Section 10.6, "Disabling a user account". It explicitly recommends expiring the account: "# chage -E 0 username".
3. usermod(8) Linux manual page. The -e, --expiredate option provides the same functionality, confirming this is a standard method for account expiration.
Keep practicing
Take the free 102-500 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 102-500 practice questions
- Question 1What output is produced by the following command sequence? echo ‘1 2 3 4 5 6’ | while rea…
- Question 2Which command will set the local machine's timezone to UTC?
- Question 3Which of the following SQL statements will select the fields name and address from the co…
- Question 4Which of the following commands can remove a user from a group?
- Question 5Where are user specific crontabs stored?
- Question 6Which of the following crontab entries will execute myscript at 30 minutes past every hou…
