Skip to content

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  07:52   56:32   0.06s  0.06s -bash
root     pts/2  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

  1. License under CC BY-NC 4.0
  2. Copyright issue feedback, replace # with @
  3. Not all the commands and scripts are tested in production environment, use at your own risk
  4. No privacy information is collected here
Try iOS App