LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   terminate all sessions (https://www.linuxquestions.org/questions/linux-newbie-8/terminate-all-sessions-737092/)

KFC123 07-01-2009 09:50 PM

terminate all sessions
 
Hi there,
I have a server running CentOS which allows user to logon remotely with ssh. As root, how can I write a script to terminate all session started by other users other than root?

stress_junkie 07-01-2009 10:40 PM

I'm not going to write your script for you but I will say that key components of such a script would be the kill utility and the killall utility.
Code:

man kill
man killall


lazlow 07-01-2009 11:46 PM

Assuming root is local, just shutdown the nics (dirty, but quick and effective).

chrism01 07-03-2009 02:16 AM

Yep, if root is on the console then

service network stop

would do it, but a bit of a blunt instrument.

service sshd stop

is better.

I think you can tweak the sshd config and bounce sshd.??


All times are GMT -5. The time now is 08:40 PM.