Skip to content

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.

23 points9 comments
Open on Reddit
About this post
Posted
Archived
Score
23 · 87% up
Kind
Text
ID
hsimab

Author

5
posts
40
comments
0
media
View profile

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.

6 points

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, while where bash returns /usr/bin/bash.

7 points

What happens if you run just bash from a fish shell?

6 points
unknown author

Deleted before we saved it.

1 points

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.

2 points

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.

1 points

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 :)

1 points

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

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.