1826925 Members
2156 Online
109705 Solutions
New Discussion

Re: login lock file

 
SOLVED
Go to solution
R.Mahendran_1
Occasional Advisor

login lock file

Dear all,

To stop the users loging in to the server,one lockfile to be created on /tmp directory or some where. I forgotten now.

Can anyone help?

HP9000 -D270 HP-UX 10.20
5 REPLIES 5
CHRIS_ANORUO
Honored Contributor

Re: login lock file

Put the word console in /etc/securetty file, and you will only have root login at the console and no other terminal.
When We Seek To Discover The Best In Others, We Somehow Bring Out The Best In Ourselves.
Andy Monks
Honored Contributor

Re: login lock file

Chris' suggest stops root login, but I must admit to not knowing of any lock file you can create to do what you want.

I'd suggest unplugging the machine from the network. Then you can just use the console.
Stefan Farrelly
Honored Contributor
Solution

Re: login lock file


/etc/securetty will stop direct root logins only, not normal users. To stop normal users you can use either;

1. Download and configuring tcpwrappers and then use the host.allow and host.deny options.

2. Use the built-in capability of inetd, /var/adm/inetd.sec is the file that enables or disables logins depending upon service specified.

3. modify /etc/profile then you can touch a file called /etc/nologin to stop users logging in, here is the code to add to /etc/proifle (below). When you want to let them back on again remove /etc/nologin

if [ -r /etc/nologin ]
then
if [ `/usr/bin/id -u` = "0" ]
then
echo "nnn"
echo " --> NOTICE <---"
echo "User login is currently disabled because of system maintenance"
echo "However, you will be allowed in."
echo "nPress Enter to continue...c"
read junk
else
sleep 2
clear
echo "nnnnnnnn"
echo " The system is currently unavailable."
echo " Please try again later."
sleep 5
exit 1
fi
fi
Im from Palmerston North, New Zealand, but somehow ended up in London...
Manju Kampli
Trusted Contributor

Re: login lock file

generally in /etc/profile there will be some lines which checks for a file like "nologin" and rejects the users to login except the root user. May be you should also try to look in to /etc/profile for the file location and also the file name
Never stop "LEARNING"
Wodisch
Honored Contributor

Re: login lock file

Changing "/etc/profile" to check for "/etc/.nologin" is not enough,
if your users log in through X-Windows! Include the same check into
"/usr/dt/config/Xsession".
HTH,
Wodisch