I learned a new command, at least I thought, because this command : chsh
, does not behave like described.
It was described to work like this:
cat /etc/shells
to know, which shells are installed,so you can choose among them.- do
echo $SHELL
to know, which shell you are using. - choose one of the shells and type
chsh -s /path/to/shell
- enter password and verify with
echo $SHELL
, that you are in a new shell.
I have done this and I got no error message when entering the password, but I was still in the same shell.
% echo $SHELL
/bin/bash
% cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
% chsh -s /bin/sh
Password:
% echo $SHELL
/bin/bash
Best Answer
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.