nerdexam
CompTIA

XK0-005 · Question #855

A Linux user would like the shell changed to /bin/bash. Which of the following commands will accomplish this task?

The correct answer is B. usermod -s /bin/bash user. To change a user's login shell to /bin/bash in Linux, the usermod command with the -s option is the correct utility.

System Management

Question

A Linux user would like the shell changed to /bin/bash. Which of the following commands will accomplish this task?

Options

  • Ausermod -g /bin/bash user
  • Busermod -s /bin/bash user
  • Cusermod -p /bin/bash user
  • Dusermod -d /bin/bash user

How the community answered

(46 responses)
  • A
    2% (1)
  • B
    89% (41)
  • C
    2% (1)
  • D
    7% (3)

Why each option

To change a user's login shell to `/bin/bash` in Linux, the `usermod` command with the `-s` option is the correct utility.

Ausermod -g /bin/bash user

The `-g` option for `usermod` is used to change a user's primary group, not their login shell.

Busermod -s /bin/bash userCorrect

The `usermod` command is used to modify existing user account properties. The `-s` option, or `--shell`, specifically allows an administrator to set a new login shell for the specified user, in this case, `/bin/bash` for the user named `user`.

Cusermod -p /bin/bash user

The `-p` option for `usermod` is used to set a user's encrypted password, not their login shell.

Dusermod -d /bin/bash user

The `-d` option for `usermod` is used to change a user's home directory, not their login shell.

Concept tested: Linux user account modification (shell)

Source: https://man7.org/linux/man-pages/man8/usermod.8.html

Topics

#Linux user management#usermod command#User shells

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice