The default shell for a user account is typically set in the /etc/passwd
file.
It possible another configuration file or process is overriding this.
It is possible that your system has a global default shell set in a configuration file such as /etc/profile
or /etc/bashrc
or your user account has a specific shell set in a user-specific configuration file such as ~/.bashrc
, ~/.profile
, etc..
These files run when a user logs in, and can override the default shell set in /etc/passwd
Look for any line that set the SHELL
, or that execute commands to setting the shell.
Try this commands too:
usermod -s /bin/bash YOUR_USERNAME
How to change from csh to bash as default shell
OR
chsh -s /bin/bash
This will change your default shell to bash.
You may need to log out and log back in for the change to take effect.
Change my default shell in Linux using chsh
Where do I change my shell?
Changing Shell to /bin/bash without root access via file
/etc/passwd
. Please also explain how you login (ssh
? GUI? Terminal window?)ssh
. The line I think sets the shell tobash
isroot:x:0:0:root:/root:/bin/bash
. But at some point in the login process the shell is changed tocsh
.root
. Are you really logging in asroot
? If not, it's irrelevantgetent passwd "$LOGNAME"
,grep passwd /etc/nsswitch.conf
, and if your login shell (as opposed toroot
's) is/bin/bash
orexec bash -l -o xtrace
/root/.profile
,/root/.bash_profile
,/etc/profile
, and files in/etc/profile.d/
. Maybe grep forcsh
in these locations.