How to Change your Login Shell


Question:
"My professor wants me to use the Korn shell(ksh), and my login shell is the C Shell (csh - the default shell you received on cyberserver.uml.edu) - how do I change it?"

Answer:  The chsh command changes the login shell of your username.

When altering a login shell, the chsh command displays the current login shell and then prompts for the new one. Here are the  most common shells, which are listed in /etc/shells:

  • /bin/sh
  • /usr/bin/tcsh
  • /usr/bin/bash
  • /usr/bin/ksh
  • /usr/bin/sh
  • /usr/bin/csh
To change your shell  use the chsh command:

The chsh command changes the login shell of your username.

When altering a login shell, the chsh command displays the current login shell and then prompts for the new one. The new login shell must be one of the approved shells listed in the /etc/shells file unless you have superuser privileges.

EXAMPLE username=johndoe
johndoe on cyberserver.uml.edu>/usr/bin/chsh
Old shell: /usr/bin/ksh
New shell: /usr/bin/csh
For Bash shell=/usr/bin/bash
If you want to see that the change occurred, do a finger on your username (finger johndoe) before the change and again after the shell change.