/etc/shells is important for login

Posted by Alex D'Andrea on 9 December 2023

After a regular update and reboot I could no longer login to my system. I had upgraded via paru -Syu as I regularely do and checked w/ pacdiff for changes to settings files. One change was displayed in /etc/shells where on first look, some entries were added:

-- shells	2023-12-09 10:41:42.292049652 +0100
+++ shells.pacnew	2023-12-09 10:41:59.229026678 +0100
@@ -3,5 +3,7 @@
 
 /bin/sh
 /bin/bash
-/usr/bin/fish
-/bin/fish
+/bin/rbash
+/usr/bin/sh
+/usr/bin/bash
+/usr/bin/rbash

It went unnoticed that fish shell entries had been removed, despite me using fish shell. Plus, instead of using merge, I obviously chose overwrite mode in pacdiff 🤷. It turns out, you cannot login to the user when your user account claims that shell but it is not registered in /etc/shells. Luckily root wasn’t affected and could repair the state by pacman -S fish - reinstalling fish shell.

The error message is just Authentication failure as response to the user, while journalctl shows login[1536]: FAILED LOGIN 1 FROM tty2 FOR ad, Authentication failure which does not point into the shells file’s direction.