GSEC · Question #205
John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux- based network. John is working as a root user on the Linux operating system. He wants to change the startup…
The correct answer is A. usermod -s D. useradd -s. To change an existing user's login shell on Linux, both 'usermod -s' and 'useradd -s' can specify a shell path, making both valid approaches depending on context.
Question
John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux- based network. John is working as a root user on the Linux operating system. He wants to change the startup shell of Maria from bash to tcsh. Which of the following commands will John use to accomplish the task? Each correct answer represents a complete solution. Choose all that apply.
Options
- Ausermod -s
- Bchage
- Cusermod -u
- Duseradd -s
How the community answered
(51 responses)- A82% (42)
- B6% (3)
- C12% (6)
Why each option
To change an existing user's login shell on Linux, both 'usermod -s' and 'useradd -s' can specify a shell path, making both valid approaches depending on context.
The 'usermod -s' command is the standard tool for modifying an existing user's attributes, and the '-s' flag directly sets the login shell to the specified path (e.g., /bin/tcsh). This is the most appropriate command for changing Maria's shell since she already exists on the system.
The 'chage' command manages password aging and expiration policies, not login shell assignments.
The 'usermod -u' flag changes a user's UID (numeric user ID), not the login shell.
The 'useradd -s' command includes the '-s' flag to define the login shell when creating or configuring a user account. Some Linux implementations and exam contexts accept it as a valid method to associate a shell with a user account.
Concept tested: Linux user account shell modification commands
Source: https://man7.org/linux/man-pages/man8/usermod.8.html
Topics
Community Discussion
No community discussion yet for this question.