Lab: Linux Bash Prompt - Change the SHELL for Bob from Bash to Bourne Shell

1.The solution provided for changing Bob’s shell from bash to sh using

sudo chsh -s /bin/sh bob

does not emphasize how we determined the path /bin/sh in the first place. This path can be found by listing the valid login shells from the /etc/shells file.

Example:

bob@caleston-lp10:~$ cat /etc/shells

/etc/shells: valid login shells

/bin/sh
/bin/bash
/bin/rbash
/bin/dash

2.After running the sudo chsh -s /bin/sh bob command to change Bob’s shell to sh, I checked the shell with the following command:

bob@caleston-lp10:~$ echo $SHELL
/bin/bash

The output shows that the shell remains /bin/bash and NOT /bin/sh.
Could you clarify why this change isn’t being applied and suggest any troubleshooting steps?

The shell is switched to the new one after you log out and log back in. The SHELL variable, once set for your current shell session, doesn’t change immediately after chsh was executed.

You can also see the effect of the shell change by opening a second shell as bob after making the change

sudo su bob
echo $SHELL
exit