Linux chsh command

Updated: 04/26/2017 by Computer Hope

About chsh

chsh changes a user's login shell.

Valid Shells

chsh will accept the full pathname of any executable file on the system. However, it will issue a warning if the shell is not listed in the /etc/shells file.

It can also be configured to accept only shells listed in this file (unless the user is root). If a shell is not specified, chsh will prompt for one to be specified.

chsh syntax

chsh [-s login_shell] [user]

-s shell

Sets shell as the login shell.

-l, --list-shells

Print the list of shells listed in /etc/shells and exit.

-u, --help

Print a usage message and exit.

-v, --version

Print version information and exit.

chsh examples

chsh -s /bin/bash fred

Set user fred's login shell to /bin/bash.

chfn — Change a user's finger information.
usermod — Modify a user's account.
passwd — Change a user's password.