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.
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)- A2% (1)
- B89% (41)
- C2% (1)
- D7% (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.
The `-g` option for `usermod` is used to change a user's primary group, not their login shell.
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`.
The `-p` option for `usermod` is used to set a user's encrypted password, not their login shell.
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
Community Discussion
No community discussion yet for this question.