How can I disable non-root logins?

How can I disable non-root logins?

Add the following to /etc/profile, then 'touch /etc/nologin'; this will
disable all new logins, except by root:

uid=`id -u`
if [ -f /etc/nologin -a $uid -ne 0 ]; then
echo "Sorry, no logins allowed; try later!"
sleep 5
exit 0
fi



Home
FAQ