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