Thursday, August 22, 2013

How to change the default login shell

The chsh command allows you to change your default login shell.

My default login shell on one server that I used frequently was ksh and having to manually switch to bash got old after a few times.  Here's how to make bash the default login shell:

1. Make sure that bash is listed in /etc/shells.
    $ cat /etc/shells
    /bin/sh
    /bin/bash
    /sbin/nologin
    /bin/ksh
    /bin/tcsh
    /bin/csh
    ...

2. Run the chsh command
    $ chsh -s /bin/bash

That's it.  The next time you log in, you'll be in the bash shell.

BTW, to see what the current shell is, run this command:
    $ echo $SHELL
Post a Comment