Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to the use of fuser and lsof

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Fuser and lsof can be used for system security checks.

Use fuser to see which users and processes are doing what somewhere:

fuser -cu /root abbreviated display

fuser -muv /mnt3 Displayed separately

Lsof has more features

# lsof -i See which ports are open in the system, which processes and users are using them, more detailed than netstat -lptu output.

# lsof -i 4 View IPv4 type processes

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME

exim4 2213 Debian-exim 4u IPv4 4844 TCP *:smtp (LISTEN)

dhclient3 2306 root 4u IPv4 4555 UDP *:bootpc

# lsof -i 6 View IPv6 type processes

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME

exim4 2213 Debian-exim 3u IPv6 4820 TCP *:smtp (LISTEN)

# lsof -192.168.1.2 View processes associated with a specific IP

COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME

amule 3620 root 16u IPv4 11925 TCP 192.168.1.2:42556->77.247.178.244:4242 (ESTABLISHED)

amule 3620 root 28u IPv4 11952 TCP 192.168.1.2:49915->118-166-47-24.dynamic.hinet.net:5140 (ESTABLISHED)

# lsof -p 5670 View files opened by processes with PID 5670.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report