linux强制踢出已登录的用户及本地用户
方法一:
pkill -kill -t pts/0
方法二:
fuser -k /dev/pts/0
你也可以给他发送关闭信息然后关闭
echo "你被管理员踢出了" > /dev/pts/1 && fuser -k /dev/pts/1
事情是这样的,一台云主机ubuntu的默认是没有开启的root的,我用新建的用户tx登录后调整可以root登录,然后使用root登录删除tx用户
root@idctxcom:~# userdel tx
userdel: user tx is currently used by process 1941 ##报错显示用人在用tx使用进程。
root@idctxcom:~# who ###查看是谁在登录
tx tty1 -- :38 ###这个是本地登录的
tx pts/0 183.14.133.4 03:40 2:25 0.03s 0.03s -bash ###这个是同事在登录
root pts/ -- : (183.14.133.4) ###这个是我自己
root@idctxcom:~# pkill -kill -t pts/0 ###踢掉同事登录
root@idctxcom:~# pkill -kill -t tty1 ###踢掉本地登录的用户
root@idctxcom:~# who
root pts/1 2019-05-17 03:43 (183.14.133.4)
root@idctxcom:~# userdel tx ##删除成功
root@idctxcom:~#
linux强制踢出已登录的用户及本地用户的更多相关文章
- Linux用root强制踢掉已登录用户;用fail2ban阻止ssh暴力破解root密码
Linux用root强制踢掉已登录用户 首先使用w命令查看所有在线用户: [root@VM_152_184_centos /]# w 20:50:14 up 9 days, 5:58, 3 use ...
- Linux用root强制踢掉已登录用户
首先使用w命令查看所有在线用户: [root@VM_152_184_centos /]# w 20:50:14 up 9 days, 5:58, 3 users, load average: 0.21 ...
- Linux踢出已登录用户
1.使用w命令可以查看当前登录系统的所有用户 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root tty1 - 08:05 4:29 0.09s 0.09s - ...
- Linux强制踢出登录用户(断线账户剔除)
首先,用w查看登录用户 :: up days, :, users, load average: 1.00, 1.01, 1.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU ...
- Linux强制关掉其他ssh登录的用户
Linux强制关掉其他ssh登录的用户 首先 用who命令查看登录的iproot pts/0 162.16.16.155 14:30 0.00s 0.07s 0.05s wroot pts/1 162 ...
- 如何解决Eureka Server不踢出已关停的节点的问题?
如何解决Eureka Server不踢出已关停的节点的问题? eureka端: eureka.server.enable-self-preservation ...
- CentOS6.5下搭建ftp服务器(三种认证模式:匿名用户、本地用户、虚拟用户)
CentOS 6.5下搭建ftp服务器 vsftpd(very secure ftp daemon,非常安全的FTP守护进程)是一款运行在Linux操作系统上的FTP服务程序,不仅完全开源而且免费,此 ...
- linux强制踢掉登录用户【转】
[root@Wang ~]# w :: up :, users, load average: 0.71, 0.58, 0.57 USER TTY FROM LOGIN@ IDLE JCPU PCPU ...
- linux下踢出已登录用户
通过xshell登录到linux,看到如下所示,有3个用户,但是前面两个不知在哪登录的了,那就踢出吧. 先确认一下自己是哪个 顺便注意一下“whoami”和“who am i”的不同 然后踢出前面两个 ...
随机推荐
- 迭代器概念与traits编程技法
//迭代器是一种smart pointer template<typename T> class ListItem { public: T value() const { return _ ...
- android中读取通讯录学习笔记
1.读取通讯录时一次读取时,尽量少读取全部属性.特别是列表展示的时候.会让你的列表载入速度变得难以忍受,建议先载入少量属性.然后在详情的时候载入全部属性. 2.在读取一类属性的时候,建议用一个游标,且 ...
- zookeeper+kafka配置
ZooKeeper 安装 #将ZooKeeper解压到/usr/local中 tar –zxvf zookeeper-3.4.6.tar.gz –C /usr/local cd /usr/local ...
- 46.Android 自己定义Dialog
46.Android 自己定义Dialog Android 自己定义Dialog 前言 提示Dialog 提示Dialog 效果图 菜单Dialog 菜单Dialog 效果图 DialogActivi ...
- 局域网部署docker--从无到有创建自己的docker私有仓库
因为GFW的关系.国内用户在使用docker的时候,pull一个主要的镜像都拉下来.更不用说使用官方的index镜像了.差点放弃使用docker了,google了一圈.总算找到办法. 第一步:安装do ...
- Linux下的应用程序开机自启动
Linux下的应用程序开机自启动,目前我知道的有2种: 1.将启动语句写到/etc/rc.local 2.在init.d放置启动脚本 第一种,很简单,直接写进去就行,比如说: /db/mongodb/ ...
- Selenium中配置链接使用FTP服务
Enable the default report solution Step1: Create a suite listener and add codes into it, please watc ...
- Timus 1146. Maximum Sum
1146. Maximum Sum Time limit: 0.5 secondMemory limit: 64 MB Given a 2-dimensional array of positive ...
- linux下的so、o、lo、a、la文件的区别
o: 编译的目标文件a: 静态库,其实就是把若干o文件打了个包so: 动态链接库(共享库) lo: 使用libtool编译出的目标文件,其实就是在o文件中添加了一些信息la: 使用libtool编译出 ...
- 47. Ext.form.Field.prototype.msgTarget
转自:https://blog.csdn.net/a1542aa/article/details/24295791 ExtJS.form中msgTarget Ext表单提示方式:msgTarget:有 ...