How do I switch from an unknown shell to bash?
I was surprised that I didn’t find this question already on the site. So, today
$ came up after I logged in as a new user. This was unexpected because my main user’s prompt starts with
So, how do I switch from this other shell to bash?
You type in
bash. If you want this to be a permanent change the default shell to
/bin/bash by editing
Here’s some snippets from my
The very last field contains the shell, Modifying the field after the last
: to a valid or invalid shell will work.
/sbin/nologin both mean the user doesn’t have a real login shell, although if pam is not set up right this doesn’t mean they can’t login (I reported a bug on this in Arch Linux, because you can login graphically without having a login shell).
/bin/zsh are both valid shells, see
/etc/shells for a list of valid shells on your systems. Here’s my
/etc/shells if you’re interested.
Yes you can use
usermod to do the same things, please remember these are just structured text files, and TIMTOWTDI.
Assuming the unknown shell supports running an absolute command, you could try:
To change the default shell, I would use
chsh(1). Sample usage:
chsh -s /bin/bash $USER
If chsh or manually editing the config won’t work, but a ~/.profile script is executed at login, add this line:
exec /bin/bash --login