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? |
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 |
Assuming root is local, just shutdown the nics (dirty, but quick and effective).
|
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. |