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.

  • Description
  • Syntax
  • Examples
  • Related commands
  • Linux commands help

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]

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.