nerdexam
GIAC

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.

Linux and Cryptography

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)
  • A
    82% (42)
  • B
    6% (3)
  • C
    12% (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.

Ausermod -sCorrect

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.

Bchage

The 'chage' command manages password aging and expiration policies, not login shell assignments.

Cusermod -u

The 'usermod -u' flag changes a user's UID (numeric user ID), not the login shell.

Duseradd -sCorrect

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

#usermod#Linux user management#shell configuration#useradd

Community Discussion

No community discussion yet for this question.

Full GSEC Practice