Change a user's login shell from the command line quickly and safely. 07.06.2026 | reading time: 2 min The chsh command updates the login shell recorded for an account in the system database; use it to switch shells without hand-editing /etc/passwd and to keep local policy intact. Hands-on example Here is a short session showing the flow from current shell to changed shell, including the interactive password step: ```\n$ echo $SHELL\n/bin/bash\n$ chsh -s /usr/bin/zsh\nChanging shell for alice.\nPassword:\n[enter password]\n# log out and back in\n$ echo $SHELL\n/usr/bin/zsh\n``` Options and rules you must know Use `chsh -s /path/to/shell` to set a new shell; `chsh -l` commonly prints allowed shells from /etc/shells on many distributions; non-root users can only change their own shell and root may change any account; the change typically takes effect after the next login and some systems enforce that the shell must appear in /etc/shells. When chsh meets central authentication chsh edits the local account database and may not work for accounts managed by LDAP, NIS or other directory services; in those environments the administrator must change the shell through the directory server or the directory management tooling, and PAM or policy can further restrict allowed shells. Nearby tools and quick fixes When you need to script or change shells for many accounts, `usermod` is often used by administrators, `getent` helps inspect account entries across name services, and viewing `/etc/shells` shows permitted shells on the host. Wrap up and next steps chsh is a small but handy tool for managing login shells; experiment on a test account, note directory-service exceptions, and then consider formalizing your skills with certifications such as CompTIA Linux+ or LPIC-1, with bitsandbytes.academy offering intensive exam preparation. Join Bits & Bytes Academy First class LINUX exam preparation. utilities setup security processes