The system (Linux) refuses all logins.

Symptom: the system refuses logins from all accounts, including root.

Because it is impossible to login using any account, in such a situation I need to use an iso to boot from and chroot into the system.
Another way is to boot with init=/bin/bash appended to the kernel line in grub.

The logs will show something like this

archlinux login[1028]: FAILED LOGIN 2 FROM tty1 FOR root, Authentication failure
archlinux login[1028]: pam_shells(login:auth): /etc/shells is either world writable or not a normal file

To fix this I had to check /etc/shells permissions, that have been changed by mistake.

[root@linux /]# ls -l /etc/shells
-rwxrwxrwx 1 root root 52 May 31  2013 /etc/shells
[root@linux /]# cat /etc/shells
# /etc/shells


# End of file
[root@linux /]# chmod 644 /etc/shells

After setting the correct permissions users can login again.