- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: How to lock out users (except root) during mai...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2000 08:46 AM
05-05-2000 08:46 AM
How to lock out users (except root) during maintenance
I'm running HPUX 11.0 on a K460, with about 600 users. The only way I can come up with is to make a copy of the /etc/passwd file and remove all users except those I want to allow access and put that in place during maintenance periods. Are there other ways of doing this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2000 09:32 AM
05-05-2000 09:32 AM
Re: How to lock out users (except root) during maintenance
One,
If you're in multiuser mode, go to maintaince mode with command shutdown
then users can't login, except root off course.
Two
From mutliuser mode make a copy of /etc/profile y named /etc/profile.old ( can be any name)
edit /etc/profile and insert the next paragraph at begining, just after the line " trap " " 1 2 3 "
.
.
.
trap " " 1 2 3
if [ "$LOGNAME" != "root" ]
then
exit
fi
Save the file with other name , eg. /etc/profile.block
Then copy file /etc/profile.blok to /etc/profile, you don't need change the level running , after this, only root can login,once that you finish your job as root, make copy from /etc/profile.old to /etc/profile to the users can login.
I'd prefer the option two.
Greetings
.
.
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2000 12:20 PM
05-05-2000 12:20 PM
Re: How to lock out users (except root) during maintenance
Be careful, though. If you are connecting remotely make sure you turn inetd back on before breaking your connection.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2000 06:28 AM
05-09-2000 06:28 AM
Re: How to lock out users (except root) during maintenance
For example in /etc/profile put these lines:
-----
if test -f /nologin
then
if [ $LOGNAME != "root" ]
then
exit
fi
fi
-----
When you want to do a maintanance then put an empty file to "/" named as "nologin". After this, nobody could login.
To accept logins remove that "nologin" named file.
Also if you want to make only some users to login to system(not only root), instead of checking user check group of the user. To do this create a group and add users to allow to login in that group. And add these lines to /etc/profile file:
if test -f /nologin
then
for ttx in `groups $LOGNAME`
do
if [ "$ttx" = "group_name" ]
then
LOGINCHK="OK"
fi
done
if [ $LOGINCHK != "OK" ]
then
exit
fi
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2000 06:29 AM
05-09-2000 06:29 AM
Re: How to lock out users (except root) during maintenance
For example in /etc/profile put these lines:
-----
if test -f /nologin
then
if [ $LOGNAME != "root" ]
then
exit
fi
fi
-----
When you want to do a maintanance then put an empty file to "/" named as "nologin". After this, nobody could login.
To accept logins remove that "nologin" named file.
Also if you want to make only some users to login to system(not only root), instead of checking user check group of the user. To do this create a group and add users to allow to login in that group. And add these lines to /etc/profile file:
if test -f /nologin
then
for ttx in `groups $LOGNAME`
do
if [ "$ttx" = "group_name" ]
then
LOGINCHK="OK"
fi
done
if [ $LOGINCHK != "OK" ]
then
exit
fi
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2000 06:29 AM
05-09-2000 06:29 AM
Re: How to lock out users (except root) during maintenance
For example in /etc/profile put these lines:
-----
if test -f /nologin
then
if [ $LOGNAME != "root" ]
then
exit
fi
fi
-----
When you want to do a maintanance then put an empty file to "/" named as "nologin". After this, nobody could login.
To accept logins remove that "nologin" named file.
Also if you want to make only some users to login to system(not only root), instead of checking user check group of the user. To do this create a group and add users to allow to login in that group. And add these lines to /etc/profile file:
if test -f /nologin
then
for ttx in `groups $LOGNAME`
do
if [ "$ttx" = "group_name" ]
then
LOGINCHK="OK"
fi
done
if [ $LOGINCHK != "OK" ]
then
exit
fi
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2000 10:46 PM
07-06-2000 10:46 PM
Re: How to lock out users (except root) during maintenance
udi=' id-u '
if [ -f /etc/nologin -a $uid -ne 0 ]; then
echo " Sorry,no login allowed, try later ! "
sleep 5
exit 0
fi