Change Default Shell

Default shell can be changed by using chsh command.

Usage

To see available shells -

$ cat /etc/shells

To see current shell -

$ echo $SHELL

To finally change shell -

$ chsh -s /path/to/shell

To see your new shell -

$ echo $SHELL

It should be changed now, in case chsh throws something like you may not change the shell for ${USER}, follow along!

Using usermod

To see current shell -

$ grep ${USER} /etc/passwd

To change shell -

$ sudo usermod --shell /bin/bash nameofuser

Verify it by running -

$ grep ${USER} /etc/passwd

Source: Unix - StackExchange

Last updated