---
title: "linux 踢出在线用户"
author: "dongwei_6688"
date: "2012-12-28T18:16:33Z"
tags: []
categories: ["操作系统"]
slug: "linux"
draft: false
lastmod: "2012-12-28T18:24:57Z"
id: 1756641
url: "https://dongwei.iteye.com/blog/1756641"
---

两个步骤：

1.用**w**命令找到要踢出的用户，比如下面：

 

```
[root@localhost ~]# w
 18:16:55 up 39 days,  8:27,  3 users,  load average: 0.03, 0.03, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
root     pts/0    61.130.130.130   18:16    2.00s  0.00s  0.00s -bash
root     pts/1    61.130.130.130   18:07   44.00s  0.03s  0.03s -bash
root     pts/2    61.130.130.130   18:16    0.00s  0.01s  0.00s w
```

 

 

2.运行**pkill**命令踢出该登录用户，比如，我要踢出上面的pts/2，则运行

 

```
[root@localhost ~]# pkill -kill -t pts/2
```