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

Prepare for the Linux Professional Institute Certification Level 1. Use flashcards and multiple choice questions, complete with hints and explanations. Enhance your understanding and get ready to ace the exam!

The command used to change the default shell for a user is "chsh," which stands for "change shell." When executed, it allows users to specify a different shell that they would like to use by default when they log in. This command modifies the user's entry in the /etc/passwd file, which stores user account information, including the default shell used at login.

When using "chsh," users typically provide the path to the new shell they want; for example, changing to the Bash shell might involve using /bin/bash. Users must have permission to change their own shell, and on some systems, root privileges may be required to change the shell for other users.

The other choices do not represent valid commands for changing a user's default shell. "shell change" and "setshell" are not recognized commands in standard Linux environments. While "usermod" can also modify user account properties, including the login shell, it is a more complex command that usually requires administrative privileges and does not offer the straightforward user interface that "chsh" does for individual users to manage their own shells. Thus, "chsh" is the most appropriate and user-friendly method for this purpose.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy