Coder Perfect

Changing default shell in Linux [closed]

Problem

What are the options for changing the default shell? Currently, the env command says:

SHELL=/bin/tcsh

I’d like to modify it to Bash.

Asked by mahmood

Solution #1

Try using the linux command chsh.

chsh -s /bin/bash is the detailed command. You will be asked to enter your password. /bin/bash is now your default login shell. To view the change, you must log out and log back in.

The following is taken directly from the man page:

This command will permanently alter the default login shell.

Note that you will not be able to utilize chsh if your user account is remote, such as on Kerberos authentication (e.g. Enterprise RHEL).

Answered by Summer_More_More_Tea

Solution #2

You can change the passwd file for a specific user directly or use the command below.

chsh -s /usr/local/bin/bash username

Then log out and back in again.

Answered by Desert Ice

Solution #3

You should have a’skeleton’ in /etc, most likely /etc/skeleton, or check the default settings, most likely /etc/default or something. Those are scripts that define how standard environment variables are set when a user logs in.

Check the (hidden) files /.profile and /.login if it’s simply for your own account. If they don’t exist, create them. The login process evaluates these as well.

Answered by arkascha

Post is based on https://stackoverflow.com/questions/13046192/changing-default-shell-in-linux