chsh
Linux · Users and permissions · reference only
What it does
Changes an account's login shell. It only accepts shells listed in /etc/shells.
Syntax
chsh [opciones] [usuario]
Options and parameters
-s shellSets the login shell.
-lLists the allowed shells in /etc/shells.
-hShows help and exits.
-VShows the version and exits.
usuarioAccount to modify; only root can change other users'.
Usage examples
chsh -lShows which shells you can choose.
chsh -s /bin/zshChanges your shell to zsh from the next login.
sudo chsh -s /bin/bash anaAs root, changes the shell of the ana account.
getent passwd ana | cut -d: -f7Checks the shell registered for ana.
Notes and common mistakes
- The change applies at the next login, not in the open session.
- If the shell is not in /etc/shells the command rejects it.