1833824 Members
2044 Online
110063 Solutions
New Discussion

How to kick off user

 
lin.chen
Frequent Advisor

How to kick off user

I found many user are in idle status by "w"
I want to force these users to leave the system and kill the process they produced.
How can I do?

Thanks and regards!
louis
4 REPLIES 4
Trng
Super Advisor

Re: How to kick off user

Dennis Handly
Acclaimed Contributor

Re: How to kick off user

By definition any "process they produced" are not idle, except the login shell.
Prasanth Vattoly
Frequent Advisor

Re: How to kick off user

You can force user to be logged out after 2 hours by setting TMOUT in /etc/profile


TMOUT=432000
readonly TMOUT
export TMOUT

But it may affect the orphan background process, which has been started by this user.

this will work if user shell is ksh or posix shell

regards
Prasanth
prasanth.v.a
Dennis Handly
Acclaimed Contributor

Re: How to kick off user

>Prasanth: You can force user to be logged out after 2 hours: TMOUT=432000

This isn't the right way to do it since it is prone to mistakes. You won't have any with this format:
TMOUT=$(( 2 * 60 * 60 ))