- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Force all users off but root
Operating System - HP-UX
1753449
Members
6211
Online
108794
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО11-03-1999 04:51 AM
тАО11-03-1999 04:51 AM
Force all users off but root
I was wondering if there was a way to force all users off the system, except
root, without going to single user mode so I can do some testing for Y2k. I
also need to be able to keep them off for a period of time. I know I could do
it by setting the users login times but I have hundreds of users and it would
take to long. I'm looking for a system wide solution.
Thank you,
Scott
root, without going to single user mode so I can do some testing for Y2k. I
also need to be able to keep them off for a period of time. I know I could do
it by setting the users login times but I have hundreds of users and it would
take to long. I'm looking for a system wide solution.
Thank you,
Scott
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-03-1999 07:47 AM
тАО11-03-1999 07:47 AM
Re: Force all users off but root
How do your users connect? If they use standard TCP access channels (telnet,
rlogin, etc) then you can simply log into the box, shut down inetd, and then
kill all user sessions. (If you are not on a console or remote console, be
very careful not to kill your own session.) You now have sole posession of the
box until you recycle inetd. If your users connect through other means you
will have to take the appropriate steps to shut them out (bring down listeners,
chmod executables, whatever).
Another means is to create a password file which contains no users other than
root and system Ids, and move that file into place during testing. The
drawback of this is that if you have any scripts or utilities that use
logname, whoami, etc to authenticate user identities, they may behave strangely
while the password file is shifted.
rlogin, etc) then you can simply log into the box, shut down inetd, and then
kill all user sessions. (If you are not on a console or remote console, be
very careful not to kill your own session.) You now have sole posession of the
box until you recycle inetd. If your users connect through other means you
will have to take the appropriate steps to shut them out (bring down listeners,
chmod executables, whatever).
Another means is to create a password file which contains no users other than
root and system Ids, and move that file into place during testing. The
drawback of this is that if you have any scripts or utilities that use
logname, whoami, etc to authenticate user identities, they may behave strangely
while the password file is shifted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-16-1999 12:23 AM
тАО11-16-1999 12:23 AM
Re: Force all users off but root
Hi Scott!!
First, log off all the users, be polite warning them via wall, then kill their
process, be care don't kill yourself, if you are root, try this shell:
for i in $(who -u | grep -v root|cut -c44-50)
do
kill -9 $i
done
make a copy from /etc/profile to /etc/profile.ori and another copy from
/etc/profile /etc/profile.lock
edit /etc/profile.lock
eg.
# @(#) $Revision: 74.2 $
# Default (example of) system-wide profile file (/usr/bin/sh initialization).
# This should be kept to the bare minimum every user needs.
# Ignore HUP, INT, QUIT now.
trap "" 1 2 3
if [ "$LOGNAME" != "root" ]
then
echo "Sorry You are not root, Conecction refused "
exit
fi
.
.
.
.
copy /etc/profile.lock to /etc/profile
do your tests and when finish, copy /etc/profile.ori to /etc/profile
I do this very often and is a system wide solution
First, log off all the users, be polite warning them via wall, then kill their
process, be care don't kill yourself, if you are root, try this shell:
for i in $(who -u | grep -v root|cut -c44-50)
do
kill -9 $i
done
make a copy from /etc/profile to /etc/profile.ori and another copy from
/etc/profile /etc/profile.lock
edit /etc/profile.lock
eg.
# @(#) $Revision: 74.2 $
# Default (example of) system-wide profile file (/usr/bin/sh initialization).
# This should be kept to the bare minimum every user needs.
# Ignore HUP, INT, QUIT now.
trap "" 1 2 3
if [ "$LOGNAME" != "root" ]
then
echo "Sorry You are not root, Conecction refused "
exit
fi
.
.
.
.
copy /etc/profile.lock to /etc/profile
do your tests and when finish, copy /etc/profile.ori to /etc/profile
I do this very often and is a system wide solution
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP