Kick out inactive user on Linux
First, use w
to check all the login user
09:19:58 up 5 days, 2:53, 2 users, load average: 1.00, 1.01, 1.00
USER TTY FROM [email protected] IDLE JCPU PCPU WHAT
root pts/1 192.168.1.100 07:52 56:32 0.06s 0.06s -bash
root pts/2 192.168.1.101 09:19 2.00s 0.03s 0.00s w
Confirm that the pts/1
user is unresponsive and kick it out with the following command
pkill -kill -t pts/1
Disclaimer
- License under
CC BY-NC 4.0
- Copyright issue feedback
me#imzye.me
, replace # with @ - Not all the commands and scripts are tested in production environment, use at your own risk
- No privacy information is collected here