Remove online linux users

Source: Internet
Author: User
1. query online users: [plain] viewplaincopy [root @ leekwen ~] # W09: 18: 37up22: 30,4 users,

1. query online users:

[Plain]View plaincopy
  1. [Root @ leekwen ~] # W
  2. 09:18:37 up, 4 users, load average: 0.00, 0.02, 0.00
  3. User tty from login @ IDLE JCPU PCPU WHAT
  4. Root pts/2 122.224.121.194 0.01 s 0.00 s tail-f/var/lo
  5. Root pts/4 122.224.121.194 0.01 s 0.01 s-bash
  6. Root pts/5 122.224.121.194 0.00 s 0.03 s 0.00 s w
  7. Root pts/3 122.224.121.194 09:17 0.00 s 0.01 s 0.01 s-bash

2. query the programs run by the pts/2 client: [Plain]View plaincopy
  1. [Root @ leekwen ~] # Ps-ef | grep pts/2
  2. Root 8998 1418 0? 00:00:00 sshd: root @ pts/2
  3. Root 9000 8998 0 00:00:00 pts/2-bash
  4. Root 9072 9000 0 00:00:00 pts/2 tail-f/var/log/messages
  5. Root 9702 9283 0 00:00:00 pts/5 grep pts/2
3. remove the pts/2 client: [Plain]View plaincopy
  1. [Root @ leekwen ~] # Kill-9 9000
  2. [Root @ leekwen ~] # Ps-ef | grep pts/2
  3. Root 8998 1418 0? 00:00:00 sshd: root @ pts/2
  4. Root 9763 9283 0 00:00:00 pts/5 grep pts/2
  5. [Root @ leekwen ~] # Ps-ef | grep pts
  6. Root 8998 1418 0? 00:00:00 sshd: root @ pts/2
  7. Root 9088 1418 0? 00:00:00 sshd: root @ pts/4
  8. Root 9090 9088 0 00:00:00 pts/4-bash
  9. Root 9281 1418 0? 00:00:00 sshd: root @ pts/5
  10. Root 9283 9281 0 00:00:00 pts/5-bash
  11. Root 9569 1418 0? 00:00:00 sshd: root @ pts/3
  12. Root 9572 9569 0 00:00:00 pts/3-bash
  13. Root 9787 9283 0 00:00:00 pts/5 ps-ef
  14. Root 9788 9283 0 00:00:00 pts/5 grep pts
  15.  

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.