- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: booting off users
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
03-13-2006 10:54 PM
03-13-2006 10:54 PM
can someone please tell me how you go about logging out users that are on the system.
thanks
john
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2006 10:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2006 11:06 PM
03-13-2006 11:06 PM
Re: booting off users
ps -ef | grep "$(who | awk '{print $2}')"
root 3484 924 0 12:58:08 pts/tc 0:00 telnetd
root 22452 924 0 10:43:23 pts/tb 0:00 telnetd
root 3485 3484 0 12:58:08 pts/tc 0:00 -ksh
root 4168 3485 1 13:01:57 pts/tc 0:00 awk {print $2}
root 4167 3485 1 13:01:57 pts/tc 0:00 ps -ef
root 22453 22452 0 10:43:23 pts/tb 0:00 -ksh
root 4169 4168 1 13:01:57 pts/tc 0:00 who
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2006 11:12 PM
03-13-2006 11:12 PM
Re: booting off users
get the process ID of user login as,
# who -u
will give the PID field number 7. Kill it as,
# kill -9
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2006 11:20 PM
03-13-2006 11:20 PM
Re: booting off users
you can run who -u
then kill -15 the PIDs
see also:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=622529
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2006 11:22 PM
03-13-2006 11:22 PM
Re: booting off users
# ps -efl | grep -v root
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2006 11:31 PM
03-13-2006 11:31 PM
Re: booting off users
You can also stop ssh daemon and telnetd from /etc/inetd.conf,
# /sbin/init.d/secsh stop
# commenting out,
# telnet stream tcp nowait root /usr/lbin/telnetd telnetd
This will ensure that, no one can login further .
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2006 11:48 PM
03-13-2006 11:48 PM
Re: booting off users
You can "su" as the user ID. and run the command "kill -9 -1"
ex:
# su - user1
$ kill -9 -1
#
Advantage with this method is, you do not require to search for all the tty's the user has logged into. Because there are scenarios wherein the user would have logged in multiple times through different tty's.
"kill -9 -1" will take care in killing all the process the user has spawned.
Regards,
Senthil Kumar .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2006 11:55 PM
03-13-2006 11:55 PM
Re: booting off users
A word of caution: grepping for user id's can lead to unwanted results because grep returns every match available.
A far better and safer way is to run something like this:
PROCESSES=`UNIX95= ps -U $USERNAME | grep -v PID |awk '{ print $1 }' | sort
-n`
for PROC in $PROCESSES
do
echo "\tKilling process $PROC"
kill -15 $PROC
sleep 1
kill -9 $PROC
done
Note that I have done a kill -15 to allow the process a chance to terminate normally and release its resources before resorting to the more brutal kill -9.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 01:01 AM
03-15-2006 01:01 AM
Re: booting off users
Why do you want to "logout" the user?
If the user were chronically not logging out correctly I would discuss the issues with him/her. I have found that some users think that by simply "hitting the X in the upper right-hand corner is the same as logging out" to quote an email reply I received from one user. So sometimes it is just a matter of education.
If it is a careless user I would discuss it with his/her supervisor, and use the stick of disabling the user's account if the continue to be careless.
As mentioned in above posts, be cautious in killing a process, as you may get undesirable results, especially if it is an application session. Examples of this could be locked records, incomplete updates, etc.
Richard