RAK部落:Linux剔除SSH登录用户

RAK部落在一些生产平台或者做安全审计的时候往往看到一大堆的用户SSH连接到同一台服务器,或者连接后没有正常关闭进程还驻留在系统内,这就造成了很多不必要的问题。

RAK部落:Linux剔除SSH登录用户
剔除SSH用户

如果登陆了许多不相干的用户,那么势必会使Linux系统内存严重不足,安全问题受到很大的威胁,所以限制SSH连接数与手动断开空闲连接也有必要之举,这里RAK部落写出手动剔除其他用户的过程。

1、查看系统在线用户
[root@testdb ~]# w
root pts/0 115.60.2.252 14:30 0.00s 0.07s 0.05s w
root pts/1 115.60.2.252 14:30 12.00s 0.01s 0.01s -bash

2.查看哪个属于此时自己的终端(我开了两个连接)

[root@testdb ~]# who am i
root pts/0 2013-12-31 14:30 (115.60.2.252)

3.pkill掉剔除自己不使用的终端

[root@testdb ~]# pkill -kill -t pts/1

4.查看当前终端情况

[root@testdb ~]# w
root pts/0 115.60.2.252 14:30 0.00s 0.04s 0.01s w

注意:
如果最后查看还是没有被剔除,可以加上-9 强制剔除。
[root@testdb ~]# pkill -9 -t pts/1

如若在操作之后还有类似问题时,RAK部落希望能够及时发现问题并解决,减少对系统造成的不必要的麻烦。

原文链接:,转发请注明来源!

发表评论

要发表评论,您必须先登录

  • 82 Responses to “RAK部落:Linux剔除SSH登录用户”
    • mexican online pharmacy

      <a href="http://canadianonlinepharmacykkr.com/">list of approved canadian pharmacies</a>
      http://canadianonlinepharmacykkr.com/
      <a href=http://canadianonlinepharmacykkr.com/>highest rated canadian pharmacies</a>

    • best online pharmacies

      <a href="http://canadianfastpharmacy.com/">canadian internet pharmacy</a>
      http://canadianfastpharmacy.com/
      <a href=http://canadianfastpharmacy.com/>list of reputable canadian pharmacies</a>

    • canadian pharmacies without an rx

      <a href="http://canadianbestpharmacyonline.com/">online pharmacies of canada</a>
      http://canadianbestpharmacyonline.com/
      <a href=http://canadianbestpharmacyonline.com/>canada drugs online</a>

    • list of approved canadian pharmacies

      <a href="http://canadianpharmacynethd.com/">canadian pharmacy reviews</a>
      http://canadianpharmacynethd.com/
      <a href=http://canadianpharmacynethd.com/>mexican pharmacies online cheap</a>

    • canadian drug stores

      <a href="http://canadianfastpharmacy.com/">mexican online pharmacies</a>
      http://canadianfastpharmacy.com/
      <a href=http://canadianfastpharmacy.com/>online canadian pharmacy</a>

    • highest rated canadian pharmacies

      <a href="http://canadiannextpharmacy.com/">canada online pharmacies</a>
      http://canadiannextpharmacy.com/
      <a href=http://canadiannextpharmacy.com/>reputable canadian online pharmacies</a>

    • mexican pharmacy online

      <a href="http://canadianpharmacynethd.com/">legitimate online pharmacies india</a>
      http://canadianpharmacynethd.com/
      <a href=http://canadianpharmacynethd.com/>reputable canadian pharmacy</a>

    • mexican online pharmacy

      <a href="http://canadianpharmacieselite.com/">online pharmacies legitimate</a>
      http://canadianpharmacieselite.com/
      <a href=http://canadianpharmacieselite.com/>canadian pharmacies online reviews</a>

    • canada drugs online review

      <a href="http://canadiannextpharmacy.com/">reputable mexican pharmacies online</a>
      http://canadiannextpharmacy.com/
      <a href=http://canadiannextpharmacy.com/>mexican border pharmacies shipping to usa</a>

    • canadian pharmacies online reviews

      <a href="http://canadianpharmacieselite.com/">mexican border pharmacies</a>
      http://canadianpharmacieselite.com/
      <a href=http://canadianpharmacieselite.com/>mexican pharmacy</a>

    • aarp approved canadian online pharmacies

      <a href="http://canadianonlinepharmacynote.com/">overseas pharmacies online</a>
      http://canadianonlinepharmacynote.com/
      <a href=http://canadianonlinepharmacynote.com/>highest rated canadian pharmacies</a>

    • canadian pharmacies online reviews

      <a href="http://canadianonlinepharmacynote.com/">online pharmacies of canada</a>
      http://canadianonlinepharmacynote.com/
      <a href=http://canadianonlinepharmacynote.com/>list of approved canadian pharmacies</a>

    • canada online pharmacies

      <a href="http://canadianpharmacyhopemeds.com/">online pharmacy</a>
      http://canadianpharmacyhopemeds.com/
      <a href=http://canadianpharmacyhopemeds.com/>canadian drug stores</a>

    • LabdAniny

      levitra 20 <a href="http://levitrarra.com/ ">levitra generic name</a> levitra generic names

    • canadian pharmacies that ship to us

      <a href="http://canadianpharmacyhopemeds.com/">canada pharmacy online</a>
      http://canadianpharmacyhopemeds.com/
      <a href=http://canadianpharmacyhopemeds.com/>overseas online pharmacies</a>

    • overseas pharmacies shipping to usa

      <a href="http://canadianonlinepharmacykkr.com/">mexican pharmacy</a>
      http://canadianonlinepharmacykkr.com/
      <a href=http://canadianonlinepharmacykkr.com/>aarp recommended canadian online pharmacies</a>

    • canada drug pharmacy

      <a href="http://canadianonlinepharmacykkr.com/">canadian pharcharmy online</a>
      http://canadianonlinepharmacykkr.com/
      <a href=http://canadianonlinepharmacykkr.com/>reputable online pharmacy</a>

    • legitimate online pharmacies

      <a href="http://canadianbestpharmacyonline.com/">online pharmacies canada</a>
      http://canadianbestpharmacyonline.com/
      <a href=http://canadianbestpharmacyonline.com/>drugstore online</a>

    • online canadian pharmacy

      <a href="http://canadianbestpharmacyonline.com/">legitimate canadian pharmacy online</a>
      http://canadianbestpharmacyonline.com/
      <a href=http://canadianbestpharmacyonline.com/>mexican pharmacies online cheap</a>

    • best mexican online pharmacies

      <a href="http://canadianpharmacyhub.com/">pharmacy online</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>reputable canadian online pharmacies</a>

    • online pharmacies

      <a href="http://canadianpharmacyguru.com/">best canadian pharmacies</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>canadian mail order pharmacies</a>

    • canadian pharmacies without an rx

      <a href="http://canadianpharmacyhub.com/">reputable canadian pharmacy</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>mexican pharmacy online</a>

    • legitimate online pharmacies

      <a href="http://canadianpharmacyguru.com/">approved canadian pharmacies online</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>canada pharmacies online prescriptions</a>

    • highest rated canadian pharmacies

      <a href="http://canadianpharmacyfit.com/">canada pharmacy online</a>
      http://canadianpharmacyfit.com/
      <a href=http://canadianpharmacyfit.com/>drugstore online</a>

    • canadian pharmacies shipping to usa

      <a href="http://canadianpharmacyfit.com/">canadian pharmaceuticals online</a>
      http://canadianpharmacyfit.com/
      <a href=http://canadianpharmacyfit.com/>reputable online pharmacy</a>

    • pharmacy online

      <a href="http://canadianpharmacycenterhd.com/">canada pharmacy online</a>
      http://canadianpharmacycenterhd.com/
      <a href=http://canadianpharmacycenterhd.com/>mexican border pharmacies shipping to usa</a>

    • reputable canadian online pharmacies

      <a href="http://canadianpharmacycenterhd.com/">discount canadian drugs</a>
      http://canadianpharmacycenterhd.com/
      <a href=http://canadianpharmacycenterhd.com/>best online pharmacies</a>

    • canada drug pharmacy

      <a href="http://canadianpharmaciespreshd.com/">overseas online pharmacies</a>
      http://canadianpharmaciespreshd.com/
      <a href=http://canadianpharmaciespreshd.com/>canadian online pharmacies</a>

    • mexican pharmacies online

      <a href="http://canadianpharmacyhub.com/">certified canadian online pharmacies</a>
      http://canadianpharmacyhub.com/
      <a href=http://canadianpharmacyhub.com/>reputable mexican pharmacies online</a>

    • canada online pharmacies

      <a href="http://canadianpharmacyguru.com/">reputable canadian pharmacy</a>
      http://canadianpharmacyguru.com/
      <a href=http://canadianpharmacyguru.com/>mexican pharmacies shipping to usa</a>

    • overseas pharmacies online

      <a href="http://canadianpharmaciespreshd.com/">canadian pharmacies online</a>
      http://canadianpharmaciespreshd.com/
      <a href=http://canadianpharmaciespreshd.com/>international pharmacies that ship to the usa</a>

    • online pharmacy canada

      <a href="http://canadianpharmacieshq.com/">overseas pharmacies shipping to usa</a>
      http://canadianpharmacieshq.com/
      <a href=http://canadianpharmacieshq.com/>mexican pharmacies online cheap</a>