ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 94 - XK0-005 discussion

Report
Export

A Linux administrator is tasked with adding users to the system. However, the administrator wants to ensure the users' access will be disabled once the project is over. The expiration date should be 2021-09-30. Which of the following commands will accomplish this task?

A.
sudo useradd -e 2021-09-30 Project_user
Answers
A.
sudo useradd -e 2021-09-30 Project_user
B.
sudo useradd -c 2021-09-30 Project_user
Answers
B.
sudo useradd -c 2021-09-30 Project_user
C.
sudo modinfo -F 2021-09-30 Project_uses
Answers
C.
sudo modinfo -F 2021-09-30 Project_uses
D.
sudo useradd -m -d 2021-09-30 Project_user
Answers
D.
sudo useradd -m -d 2021-09-30 Project_user
Suggested answer: A

Explanation:

The command that will accomplish this task is sudo useradd -e 2021-09-30 Project_user. This command will create a new user account named Project_user with an expiration date of 2021-09-30. The -e option of useradd specifies the date on which the user account will be disabled in YYYY-MMDD format.

The other options are not correct commands for creating a user account with an expiration date. The sudo useradd -c 2021-09-30 Project_user command will create a new user account named Project_user with a comment of 2021-09-30. The -c option of useradd specifies a comment or description for the user account, not an expiration date. The sudo modinfo -F 2021-09-30 Project_user command is invalid because modinfo is not a command for managing user accounts, but a command for displaying information about kernel modules. The -F option of modinfo specifies a field name to show, not an expiration date. The sudo useradd -m -d 2021-09-30 Project_user command will create a new user account named Project_user with a home directory of 2021-09-30.

The -m option of useradd specifies that the home directory should be created if it does not exist, and the -d option specifies the home directory name, not an expiration date. Reference: useradd(8) -Linux manual page; modinfo(8) - Linux manual page

asked 02/10/2024
Marco Morsiani
45 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first