Try "w"
It shows who is logged in, and what they're doing.
TO kill a "rogue" login: Just  kill their first session, the rest will
go with it.

For example:
(I ssh'd into a box for this one)

[ric@ibu ric]$ w
  7:05am  up 3 days,  1:15,  1 user,  load average: 2.00, 2.00, 2.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
ric      pts/0    120.100.33.65.cf  7:05am  0.00s  0.58s  0.07s  w


You'll see that I'm logged in on pts/0
To kick me out, grab the process id from that:

ps -ef | grep "pts/0"

[ric@ibu ric]$ ps -ef | grep "pts/0"
ric      11282 11280  1 07:05 pts/0    00:00:00 -bash
ric      11415 11282  0 07:06 pts/0    00:00:00 ps -ef
ric      11416 11282  0 07:06 pts/0    00:00:00 grep pts/0

To thow me out, the admin would just "kill 11282", and I'm out.

Something in the foggy part of my brain remembers an easier way, but it
won't come out. And the above has always worked for me.

Ric




On Fri, 2003-01-24 at 09:34, Stone, Timothy wrote:
> Excuse the pun. :) I need help with determining the users logged in, etc.
> 
> Given this actual example:
> 
> 1. [tstone@vahalla tstone]$ who -l -H
> 2. USER     LINE     LOGIN-TIME   FROM
> 3. tstone   pts/0    Jan 21 16:21
> 4. tstone   pts/1    Jan 21 16:21
> 5. tstone   pts/4    Jan 15 15:26
> 6. tstone   pts/2    Jan 21 16:22
> 7. tstone   pts/3    Jan 24 09:29 (10.40.100.80)
> 
> I'm trying to run down the logins...
> 
> Line 1 is of course the command the produced the output.
> Line 2 is the result of the -H switch
> Line 3-6 are the logins in question.
> Line 7 is the login that produced the output
> 
> Looking closely at the four (4) logins associated with Lines 3-6:
> 
> Lines 4 & 6 are stdin logins (terminals open in konsole)
> 
> What are lines 3 & 5? As close as I can determine Line 5 is the login associated 
>with restarting the box. But I haven't the faintest clue what Line 3's login is for.
> 
> Is there a more descriptive tool that points back to the processes or reasons for 
>the logins?
> 
> Finally, if I find a rogue login, how can I terminate it?
> 
> Warmest Regards,
> Tim
> 
> --
> /**
>  * Timothy Stone      . Sun Certified Java Programmer
>  * Web Master         . tstone at cityofhbg dot com
>  * City of Harrisburg . 717.255.7297
>  * Pennsylvania USA   . 717.903.9162
>  *
>  * "Censorship always defeats its own purpose,
>  *  for it creates in the end the kind of society 
>  *  that is incapable of exercising real discretion."
>  *  --Henry Steele Commager, Historian
>  */
-- 
Ric Tibbetts <[EMAIL PROTECTED]>



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to