1. query online users: [plain] viewplaincopy [root @ leekwen ~] # W09: 18: 37up22: 30,4 users,
1. query online users:
[Plain]View plaincopy
- [Root @ leekwen ~] # W
- 09:18:37 up, 4 users, load average: 0.00, 0.02, 0.00
- User tty from login @ IDLE JCPU PCPU WHAT
- Root pts/2 122.224.121.194 0.01 s 0.00 s tail-f/var/lo
- Root pts/4 122.224.121.194 0.01 s 0.01 s-bash
- Root pts/5 122.224.121.194 0.00 s 0.03 s 0.00 s w
- 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
- [Root @ leekwen ~] # Ps-ef | grep pts/2
- Root 8998 1418 0? 00:00:00 sshd: root @ pts/2
- Root 9000 8998 0 00:00:00 pts/2-bash
- Root 9072 9000 0 00:00:00 pts/2 tail-f/var/log/messages
- Root 9702 9283 0 00:00:00 pts/5 grep pts/2
3. remove the pts/2 client:
[Plain]View plaincopy
- [Root @ leekwen ~] # Kill-9 9000
- [Root @ leekwen ~] # Ps-ef | grep pts/2
- Root 8998 1418 0? 00:00:00 sshd: root @ pts/2
- Root 9763 9283 0 00:00:00 pts/5 grep pts/2
- [Root @ leekwen ~] # Ps-ef | grep pts
- Root 8998 1418 0? 00:00:00 sshd: root @ pts/2
- Root 9088 1418 0? 00:00:00 sshd: root @ pts/4
- Root 9090 9088 0 00:00:00 pts/4-bash
- Root 9281 1418 0? 00:00:00 sshd: root @ pts/5
- Root 9283 9281 0 00:00:00 pts/5-bash
- Root 9569 1418 0? 00:00:00 sshd: root @ pts/3
- Root 9572 9569 0 00:00:00 pts/3-bash
- Root 9787 9283 0 00:00:00 pts/5 ps-ef
- Root 9788 9283 0 00:00:00 pts/5 grep pts
-