To change a user's shell in Linux, you can use the usermod command with the -s option. Here’s how to do it:
Open a terminal.
Run the following command, replacing
/path/to/new/shellwith the desired shell (e.g.,/bin/bash) andusernamewith the actual username:sudo usermod -s /path/to/new/shell usernameTo verify the change, you can check the user's entry in the
/etc/passwdfile with the following command:sudo grep -w 'username' /etc/passwd
You should see the new shell listed at the end of the user's entry.
