Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

users

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
2  
What is the actual question? –  Renan Jun 9 '12 at 21:26
2  
@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
add comment

2 Answers

Running

/bin/ls -u redmage 

Just gave me:

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

However,

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
add comment

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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