Page 1 of 1

Howto: Linux kill and logout users + getting information

Posted: 21 Apr 2010, 13:41
by viking60
There is a package called procps. It includes various useful (read as nifty) utilities. One of such utility is skill which is responsible to send a signal to users and process such as:

* Halt user terminal
* Kill user and logout
procps is most likely allredy installed on your distro so it's commands are ready to use.

How to halt/stop user called bill_gates:

su

Code: Select all

# skill -STOP -u bill_gates

How to resume already halted user called bill_gates:

Code: Select all

# skill -CONT -u bill_gates

Now over to the more likely alternatives:
How to kill and logout user called bill_gates:

Code: Select all

# skill -KILL -u bill_gates

And in case you get tired of all your users:
Kill and logout all users:

Code: Select all

# skill -KILL -v /dev/pts/*


That is just fine, but how do I know what users are logged inn to my system - you say?
procps has some nifty commands:
In a terminal -simply type:

Code: Select all

#w

and all the users will show

Here are some other commands from procps:

Code: Select all

# kill  : Send signal to a process aka kill process
# top : Display Linux tasks and other important stuff
# vmstat : Display virtual memory statistics
# free : Display free and used memory (RAM) statistics
# slabtop : Display kernel slab cache information in real time