Change Default CLI Shell

bash, zsh, sh, oh my!

Contents


Using chsh

From the manual:

The chsh command changes the user login shell. This determines the name of the user's initial login command. A normal user may only change the login shell for her own account; the superuser may change the login shell for any account.

chsh -s {/path/to/shell} {username}

Examples

Change the shell for current (logged in) user
chsh -s /bin/zsh
Change the shell for another user (logged in as root)
sudo chsh -s /bin/zsh hsimpson

Where hsimpson is the user ID.

Check available shells

cat /etc/shells 

# /etc/shells: valid login shells
/bin/sh
/bin/bash
/bin/rbash
/bin/dash
/bin/zsh