Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX System Administrator's Guide: Configuration Management: HP-UX 11i Version 3 > Chapter 2 Configuring System Parameters

Preventing Users from Logging In

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

One of the issues for system administrators is how to keep nonsuperusers from logging in to a system while system configuration or system maintenance is underway. This can be accomplished with the combination of the /etc/nologin file and the NOLOGIN variable in the /etc/default/security file.

If /etc/nologin exists and NOLOGIN=1, nonsuperusers are barred from logging in. What they will see is a system-generated message (Only...security) followed by the contents of /etc/nologin. For example:

Only superusers are allowed to login at this time due to the presence of the file /etc/nologin and NOLOGIN option set in /etc/default/security -=+ SYSTEM MAINTENANCE +=- This system (hprdc185) is undergoing system maintenance. We expect to return to full service on Thursday morning at 9 a.m. Pacific Time. Thank you.

Procedure 2-2 To set up the login barricade

  1. Create or edit the file /etc/nologin. It can be empty, but users might appreciate some information on why the system is unavailable.

  2. Edit the file /etc/default/security and set the NOLOGIN line to NOLOGIN=1.

Procedure 2-3 To restore normal system access

  • Do at least one of the following:

    1. Edit the file /etc/default/security and set the NOLOGIN line to NOLOGIN=0.

    2. Delete the file /etc/nologin.

You can also use the ch_rc command to modify the NOLOGIN variable (see ch_rc(1M)).

# /usr/sbin/ch_rc -a -p NOLOGIN=1 /etc/default/security # /usr/sbin/ch_rc -a -p NOLOGIN=0 /etc/default/security
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2008 Hewlett-Packard Development Company, L.P.