LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   root account: how to log off all existing sessions (https://www.linuxquestions.org/questions/linux-newbie-8/root-account-how-to-log-off-all-existing-sessions-751468/)

fzanella 08-31-2009 07:30 AM

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

repo 08-31-2009 07:39 AM

Use the who command to see list of logged in users and
Code:

pkill -KILL -u username
to log out user.

colucix 08-31-2009 07:43 AM

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.

kdelover 08-31-2009 08:11 AM

kill -9 echo$(lsof -t -u <username>)
Or

pkill -9 -u <username>

any of this should work

chrism01 08-31-2009 06:36 PM

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

telinit 1


All times are GMT -5. The time now is 02:19 AM.