LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-31-2009, 08:30 AM   #1
fzanella
LQ Newbie
 
Registered: Feb 2009
Posts: 21

Rep: Reputation: 1
root account: how to log off all existing sessions


I am logged in as root on a RHEL5.3 machine. There are several other users logged in, I need to log everyone off to install some updates. What is the easiest way to do this?
thanks, Fabrizio
 
Old 08-31-2009, 08:39 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Use the who command to see list of logged in users and
Code:
pkill -KILL -u username
to log out user.
 
Old 08-31-2009, 08:43 AM   #3
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Take a look at command skill from the procps package. However, take in mind that using wall before skill to advice users to logout is fair and can prevent data losses. Every time I need to do some administrative tasks, I schedule the downtime at least two or three days in advance and I notify all the users by e-mail. In this way they don't ever login at the scheduled time/day.
 
Old 08-31-2009, 09:11 AM   #4
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Rep: Reputation: 36
kill -9 echo$(lsof -t -u <username>)
Or

pkill -9 -u <username>

any of this should work
 
Old 08-31-2009, 07:36 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Yep, give then decent warning, both email (long term) and wall (short term ie minutes) then switch to single user mode

telinit 1
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"To add a new user account, log in to the root account" how do i do this (im new) pierce77x Linux - Newbie 4 12-28-2008 03:44 PM
Why is my common account can't open Terminal in XFCE4 but root account? notsay Slackware 4 08-19-2007 12:29 AM
Editing Sessions Startup programs from a different user account phrozenfearz Ubuntu 3 03-14-2007 08:16 PM
Root can log on, user account can't. "Error in service module" Charlie Spencer Linux - Newbie 3 09-13-2006 02:35 PM
is it legitimate and allowed and can be done to make another user account set uid and gid to null 0 to make another root account with different name and possibly not damage the debian system creating and using that new account BenJoBoy Linux - Newbie 12 01-29-2006 11:02 AM


All times are GMT -5. The time now is 04:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration