ban the users...

how can superuser stop all other users login on system without changing in /etc/passwd file and without using userdel command?

Check if your OS supports:

echo "Sorry, no one allowed here but root!" > /etc/nologin

Will be deleted after a reboot automatically iirc.

Hi,
Type a message into the file /etc/nologin, then this will be shown and the login will be refused.

See man nologin

/Lakris

it's coooool.
but how does it work?
how creation of /etc/nologin file restrict all the users except superuser....:eek:

Because It Does. The login binary looks for this file. man login