Register /bin/bash as the login shell for new user dev01.
Which command is appropriate?
useradd -s SHELL sets the login-shell field for a new account.
Detailed explanation
useradd -d /bin/bash dev01Incorrect. -d specifies the home directory path.
useradd -g /bin/bash dev01Incorrect. -g specifies the primary group.
useradd -s /bin/bash dev01Correct. -s /bin/bash sets the login shell.
useradd -G /bin/bash dev01Incorrect. -G specifies supplementary groups.
Try it yourself
An example you can run in a temporary verification environment.
useradd --help | grep -E -- '-s,|--shell'Expected result
-sまたは--shellの説明行Key points
- -s selects the shell
- -d selects the home
- -g and -G select groups
Notes
- Environment: shadow-utils useradd help / 状態変更なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Account record
Identity attributes such as a user ID, home directory, and login shell.
Group membership
Primary and supplementary groups used during permission checks.
Password aging
State and time limits that control password changes and account access.