Linux chsh command

Updated: 05/04/2019 by Computer Hope
chsh command

On Unix-like operating systems, the chsh command sets a user's login shell, the program which provides the command line. The change takes effect the next time the user logs in.

This page describes the GNU/Linux version of chsh.

Description

chsh accepts 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 prompts for one to be specified.

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.

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.