Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I opened a VNC server and my VNC session is suddenly dead. I have lot of xterms open. When I ssh to the machine. and type


I see a bunch of users – my user accounts, like:

userA UserA UserA UserA UserA UserA UserA

I know I can use

pkill -u usersname 

Since I can only log in as userA, every time I run pkill-u UserA, it will just kill my current session. but other userAs are still there

What can I do?

share|improve this question
What is the actual question? – Renan Jun 9 '12 at 21:26
@Renan I assume he wants to kill those extra user sessions. – slhck Jun 9 '12 at 21:27
exactly. other sessions are not killed, but my current session is killed – Grey Jun 9 '12 at 21:28
@slhck That's what I assumed, too. But he edited the question for clarification. – Renan Jun 9 '12 at 21:28

A useful tools is slay: sudo slay username If you don't run slay as root, you will end up killing off all of your processes however, rather than the specified user.

See also:

share|improve this answer

Get all of userA's PIDs other than that of your current shell with:

/bin/ls -u userA | egrep -v "^ +$$"

(Note the double quotes in the egrep command.) Then kill just those PIDs. Your shell should remain.

share|improve this answer


/bin/ls -u redmage 

Just gave me:

/bin/ls: cannot access redmage: No such file or directory


who -u

Told me who is logged in, and printed the associated pid, EG:

redmage  tty4         2012-06-09 22:05 00:01         695
bluemage  pts/1        2012-06-09 18:28   .          3466 (:0.0)

Then just kill -9; No more CPU time!

kill -9 695
share|improve this answer

It seems like pkill -u someusername attempts to kill all processes from someusername.

What I think happens if you try to do this, is that you kill the processes from your own session succesfully, and fail to kill the other processes because you are not permitted to do so.

Though untested, I believe this should do the trick:

sudo pkill -u usersname 
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .