1835819 Members
3319 Online
110085 Solutions
New Discussion

user login

 
Peter Roege
Advisor

user login

hi very simpel one
how do i see which user is logged into the system and how do i removed that user.
Reason is i have som problem with me system is haltet with a brodcast from root
and when i running LAST it seams that a user "holger" is logged into the system

Peter Røge SIEMENS Denmar
4 REPLIES 4
Kent Ostby
Honored Contributor

Re: user login

ps -ef | grep sh

This will show you which shells are running ( a few other things as well )

Send kill messages to the pid # for users running "shells".

fred 12630 12629 0 Mar 9 ttyq3 0:00 -sh

For instance, here you would do:

kill 12630

to kill Fred's shell.

Best regards,

Oz
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
G. Vrijhoeven
Honored Contributor

Re: user login

Hi Peter,

You can use the whodo command.
This also will provide you with pids to kill the user sessions, however a shutdown will do the kills on active user sessions for you.

Regards,

Gideon
Gordon  Morrison
Trusted Contributor

Re: user login

who -u
This will show you who is logged in, the PID of their login shell, and where they logged in from.
What does this button do?
Amit Agarwal_1
Trusted Contributor

Re: user login

you can use the following command to kill the login shells for user you want to remove. Replace with the actual user name.

kill `who -u | grep | awk '{print $7}' | xargs`

If there are multiple users you can as well give

kill `who -u | grep -e -e | awk '{print $7}' | xargs`