LinuxMoz

Linux Stuff && Coffee

Chsh Linux Command

The chsh command is used to change a users login shell, interactively or on the command line. If a shell does not exist in /etc/shells then specify the full path to the shell.

When would you use the chsh Linux command

  • How to change a Linux users login shell
  • change unix login shell
  • change bash to sh or corn shell

chsh Usage

Usage instruction for the chsh command, note the chsh command will prompt for your password (only a privileged user can change another user’s shell.

1
chsh [options] [username]

chsh Options

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-l, –list shells

Lists valid shells from /etc/shells, then exits

-s shell, –shell shell

Change Linux login shell

-u, –help

Print help message & exit

-v, –version

Print version information and then exit

chsh Examples

Change the Linux login shell to bash:

1
 chsh -s /bin/bash

Change the Linux login shell to korn shell:

1
 chsh -s /bin/ksh

Change the Linux login shell to tcsh:

1
chsh -s /bin/tcsh

Comments