Why am I not able to change the shell with the chsh command?
Log out and log in again.
The chsh
command will update the /etc/passwd
file, but it does not change the current shell nor the value of the $SHELL
variable in the current shell (it has no way of doing that). This is the reason you need to log in again; you have to start a new login session for a change to take effect.
Using usermod utility command worked in my case. Running on the ubuntu 18.04.
- First, check current value
grep nameofuser /etc/passwd
- change it
sudo usermod --shell /bin/bash nameofuser
- Verify it
grep nameofuser /etc/passwd