unable to login with bash as default shell
hello,
I was testing fish few weeks ago but wanted to revert to bash (habit, etc...), unfortunately, when set back to bash, I am unable to login in a tty, I don't use any graphical manager.
I have removed any configuration related to bash, even created another account and it still not possible.
set fish again and it works.
no clues within the logs beside the "fail to log in" which does not make sens.
About this post
- Posted
- Archived
- Score
- 23 · 87% up
- Kind
- Text
- ID
- hsimab
10 comments
Hmm, try sudo -u $(whoami) bash
If you wanna change bash like a default shell, use: chsh $(which bash)
Or, if you have a error, send a screenshot, or text of error.
I don’t believe the second command will work, as IIRC there are restrictions on where login shells can be.
It has to be
chsh /bin/bash, whilewhere bashreturns/usr/bin/bash.The allowed shells are listed in /etc/shells and the path you pass to chsh must match exactly.
What happens if you run just
bashfrom a fish shell?Deleted before we saved it.
You know what?
I just tested /bin/bash and it works! Yay! or not! :)
$(which bash) returns /usr/bin/bash and this is the real place, this is what I used so far.
/bin is a freaking symlink to /usr/bin BUT using the real path does not work for bash HOWEVER, it does for fish.
Weeks since I try to fix it and because of this subtlety I never tested with the symlink. I am fed up or want to cry or both.
OK, fish is obviously superior for interactivity and I should use it but my usual bash oneliners are not transferable as-is and I am lazy to learn the fish way.
You should checkout zsh, I had the same experience as you regarding bash and fish not being compatible in syntax, but this doesn't seem to be as big of a problem for zsh. Very rarely will some syntax error be because of zsh, and I think it feels more modern than bash.
You may also want to check out oh-my-zsh, though personally I like it minimal so I've written my own prompt.
Thanks /u/cosraw I know and used zsh for a long time, I was just looking at minimal "modern" shells.
I will probably go back to fish and rebuild my muscle memory when I find time :)
This is what i use
##Change users shell with usermod
usermod --shell /bin/bash <Username>
## Add the bash shell /usr/local/bin/fish to /etc/shells with:
echo /usr/local/bin/bash | sudo tee -a /etc/shells
## Change your default shell to bash with:
chsh -s /usr/local/bin/bash