I tried fish for a while, and then i wanted to set it as my default shell. I edited /etc/passwd and changed the shell of my user to /bin/fish.

The problem is I couldn't login anymore. I tried through my DM (SDDM), it said the login failed at any password I threw at it, correct or wrong. Then I tried it through a tty, got the same results. Replacing fish with the shell I had before in my passwd file seemed to fix this.

Is there any way to set fish as the default shell and still be able to login?

I am running Manjaro Linux.

  • 1
    Your primary mistake was editing /etc/passd by hand. Had you used the appropriate command to change your login shell (e.g., chsh) it would/should have warned you about the problem. – Kurtis Rader Jan 18 '19 at 5:42

You need to add this shell to /etc/shells. The manual reads:

/etc/shells is a text file which contains the full pathnames of valid login shells. This file is consulted by chsh(1) and available to be queried by other programs.

Be aware that there are programs which consult this file to find out if a user is a normal user; for example, FTP daemons traditionally disallow access to users with shells not included in this file.

In my Kubuntu this is the content of /etc/shells:

# /etc/shells: valid login shells

As you can see its format is quite self-explanatory. In my case fish is there as /usr/bin/fish. Make sure the right path in your case is /bin/fish and add it to your file.

Note it's better to use chsh to change your login shell, instead of editing /etc/passwd by hand. If you did

chsh -s /bin/fish

you would probably get

chsh: /bin/fish is an invalid shell

Investigating this issue (with man 1 chsh) would probably reveal the existence of /etc/shells to you.

The tool is designed to be run by unprivileged users. If the content of /etc/shells (which is governed by root) is sane, then it's usually impossible for users to lock themselves out. By editing /etc/passwd you may not only lock yourself out like you did; you may (by mistake) break more.


I believe Linux requires that all valid login shells be listed in /etc/shells. Add fish to that file before setting it as your login shell. Be sure to use its full correct path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.