Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

restricting login 1

Status
Not open for further replies.

rene1000

IS-IT--Management
Apr 9, 2002
89
NL
I want to restrict users to login during server maintenance, without changing to maintenance mode. How can i do this ?

i read somewhere that i should create an empty file /etc/nologin to do this but that doesn't work.

 
I dont have access to a SCO server, but i think if you use /etc/nologin, you need to have something in /etc/profile
which tests for the file and aborts the login if it is there.
 
What I have done on my SCO Openserver system is add the following to the /etc/profile:

########################################################
# If you remove the # users will not be able to login #
# to allow users back on put the # (comment) back at #
# the beginning of the lines. #
# Do not remove the # from these comment lines, start #
# with the line that has the case and the last line #
# is esac. #
########################################################
# Start below here. #
########################################################
case `logname` in
root) echo "Only root can log in.";;
*) echo " "
echo "System Maintenance is being performed."
echo "Please try later ...."
echo " "
exit;;
esac
########################################################
# End above here. #
########################################################

This allows me to keep the system up in multiuser mode and not allow any new users on the system, unless they have the root password. You would still need to get users off the system, if there were users on prior to implementing this. You can then comment out the script to allow other users back into the system.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top