nologin

Alternative shell that prevents a user from logging in. More information: https://manned.org/nologin.5.

chsh -s user nologin

echo "declined_login_message" > /etc/nologin.txt