Linux系統下強制踢掉登入使用者

來源:互聯網
上載者:User

標籤:linux   踢除   使用者   強制   

           Linux系統下強制踢掉登入使用者


linux系統root使用者可強制踢制其它登入使用者,首先可用w命令查看登入使用者資訊,顯示資訊如下:
 [[email protected] ~]# w
 15:49:22 up 18:24,  5 users,  load average: 0.00, 0.03, 0.10
USER     TTY        [email protected]   IDLE   JCPU   PCPU WHAT
root     tty1           2days  0.11s  0.00s xinit /etc/X11/xinit/xinitrc -- /usr/bin/X :0 vt1 -auth /root/.serverauth
root     pts/0     14:05    1:54   0.20s  0.20s bash
oracle   pts/1     14:16   40:26   0.19s  0.18s -bash
root     pts/2     15:09    1:46   0.47s  0.47s -bash
root     pts/3     15:49    2.00s  0.34s  0.21s w    
     

    強制踢人命令格式:pkill -kill -t tty

pkill -kill -t tty1

pkill -kill -t pts/1


    解釋:

    pkill -kill -t  踢人命令

   tty 所踢使用者的TTY

   如上踢出oracle使用者的命令為: pkill -kill -t pts/1

   只有root使用者才能踢人,至少我測試的是這樣的。如果同時有二個人用root使用者登入,任何其中一個可以   踢掉另一個。任何使用者都可以踢掉自己-_-


   如何踢掉用終端登陸的使用者,如: 
  root     pts/0     14:05    1:54   0.20s  0.20s bash

   首先用命令查看pts/0的進程號,命令如下:
   [[email protected] ~]# ps -aux |grep pts/0
root      98041  0.0  0.1 116664  2988 pts/0    Ss+  14:05   0:00 bash
root     109210  0.0  0.0 116840   988 pts/3    R+   15:58   0:00 grep --color=auto pts/0   踢掉使用者的命令:
   kill -9 98041


本文出自 “技術成就夢想” 部落格,請務必保留此出處http://pizibaidu.blog.51cto.com/1361909/1612428

Linux系統下強制踢掉登入使用者

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.