System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Block all the user log in into unix

SOLVED
Go to solution
Chui Kock You_1
Frequent Advisor

Block all the user log in into unix

Hi,

What is the easy way to block all user log in into Unix?

Regards
Chui
3 REPLIES
singh sanjeev
Trusted Contributor
Solution

Re: Block all the user log in into unix

create a file name :

/etc/nologin

only root account is allowed
Sanjeev Singh
Michal Kapalka (mikap)
Honored Contributor

Re: Block all the user log in into unix

hi,

Create a file security in /etc/default and Put NOLOGIN=1 File owner will be root with 644 permissions. Also create a file in /etc/nologin and Put the message in there so that users gets it.

or aditional option :

For older versions of HPUX, you can add this bit of logic to the /etc/profile. Then "touch /etc/nologin"



for the /etc/profile to prevent user logins during system maintenance while
in multiple mode:

if [ -f /etc/nologin ]
then
if [ $LOGNAME != "root" ]
then
echo "System maintenance is be performed and users are being"
echo "prevented from accessing the system."
sleep 5
exit
fi
fi

mikap
ani007
Super Advisor

Re: Block all the user log in into unix

To prevent Direct Login to specific ids, Add them in /etc/no_login_allowed.