Is there a simple way for me to force another user off of a linux box, while I am logged in as root? I understand that I could determine what type of session they have open, and kill the pid - but I'm thinking there must be a command to do this that I don't know about.

Any ideas?

link|improve this question

76% accept rate
feedback

2 Answers

up vote 10 down vote accepted

slay(1) him.

link|improve this answer
Ha! Neat. I'd never heard of this command before. Is it available on all systems? Sure looks like it beats killing their shell process. – Jonathon Watney May 5 '09 at 19:27
It's probably packaged for all distros, but if you need something that works everywhere, skill from procps---as Mihai points out---might be a better choice. It has less style though ;-) – David Schmitt May 6 '09 at 7:31
openSuse 11.4 - slay: command not found :( :( – djechelon 2 days ago
feedback

You can kill all of an user's processes via skill. Example:

  • skill -TERM -u username

will send SIGTERM to all of username's processes. To kill them for good (via SIGKILL) use -KILL instead of -TERM - please note, though, that you will most likely cause them to lose data that way. It's highly effective, mind you...

skill is part of the procps package which is installed by all distributions by default.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.