Kick out inactive user on Linux

首先,用w查看登录用户

 09:19:58 up 5 days,  2:53,  2 users,  load average: 1.00, 1.01, 1.00
USER     TTY      FROM             LOGIN@   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

确认pts/1用户无响应,将其剔除

pkill -kill -t pts/1