Which command can be used to change the default shell for a user?

Prepare for the LPI 101-500 Certification Exam. Utilize flashcards, navigate multiple choice questions, and benefit from hints and explanations. Begin your Linux certification journey today!

The command used to change the default shell for a user is "chsh," which stands for "change shell." This command allows users to modify their login shell, and it is typically utilized to select a different shell from the ones available on the system.

When a user executes the chsh command, they can specify a new shell via the command line or through interactive prompts. The changes are applied to the user’s profile, and the new shell will be initiated the next time the user logs in. This is important for users who prefer working with a different shell environment, such as switching from Bash to Zsh or vice versa.

Other commands, such as usermod, are more versatile and can perform a variety of user account modifications, including changing the user's default shell, but they require root privileges and are not as user-friendly for this specific task. The set_shell command is not a standard command in typical Linux distributions, and passwd is dedicated to changing user passwords, making it irrelevant for shell changes.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy