Link to home
Start Free TrialLog in
Avatar of pipporosso
pipporosso

asked on

Dead/orphan users

Is there an easy method to clean up dead or orphan users.  I have some users log on to a linux server, but don't exit cleanly.  I'm not an expert on linux, but the box is being used as a proxy, but there are users who log on to configure or restart certain services and don't exit cleanly.  I would like to know if there is some method available to clean up orphan user sessions.
pipporosso
Avatar of jlevie
jlevie

If you look at the process list and find their shell you can kill that and "log them out".  As an example to kill the session for user jtest I'd do:

# ps -ef | grep jtest | grep -v grep
jtest     4100  4098  0 12:06 ?        00:00:00 /usr/sbin/sshd
jtest     4102  4100  0 12:06 pts/1    00:00:00 -bash
# kill -9 4102
See if you have the program pkill on your system. On my SuSE system it was installed with the ps package. pkill can be used to kill all processes that are owned by a specified user. This example kills all processes owned by the user "test"

pkill -9 -U test

You need to be root in order to kill processes owned by other users.
ASKER CERTIFIED SOLUTION
Avatar of pjedmond
pjedmond
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial