Sometimes it is useful to change the current shell for any users. chsh command can help you to manage your login shell.
To determine the available shells on your system, run the following command.
# chsh --list
(or)
# cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/dash
/bin/ftpsh
/bin/tcsh
/bin/csh
(or)
# cat /etc/shells
/bin/sh
/bin/bash
/sbin/nologin
/bin/dash
/bin/ftpsh
/bin/tcsh
/bin/csh
To verify the current shell,
# echo $SHELL
/bin/bash
/bin/bash
You have decided to change your shell from /bin/bash to /bin/sh, use the command:
# chsh -s /bin/sh
Changing shell for root.
Shell changed.
Changing shell for root.
Shell changed.
Do you thing to change shell for specific user just run the command,
# chsh -s /bin/bash username
Changing shell for test.
Shell changed.
# cat /etc/passwd | grep username
username:x:500:500::/home/test:/bin/sh
Changing shell for test.
Shell changed.
# cat /etc/passwd | grep username
username:x:500:500::/home/test:/bin/sh
-s or --shell => Specify your login shell.
Verify your shell login has changed?
# echo $SHELL username
/bin/sh username
/bin/sh username
Comments (0)