“Linux”的版本间的差异
跳到导航
跳到搜索
第15行: | 第15行: | ||
== 端口检测 == | == 端口检测 == | ||
* telnet | * telnet | ||
− | + | 在telnet连接成功后,使用<code>Control +]</code>然后使用<code>Control + D</code>退出它。 | |
列出所有TCP连接套接字 | 列出所有TCP连接套接字 | ||
<nowiki> | <nowiki> |
2019年5月5日 (日) 17:16的版本
工具
- [jq] 一个轻量级且灵活的命令行JSON处理器
其他
端口检测
- telnet
在telnet连接成功后,使用Control +]
然后使用Control + D
退出它。
列出所有TCP连接套接字
sudo netstat --all --numeric --tcp --programs
- lsof
监听ipv4进程
sudo lsof -n -i4TCP:5672 | grep LISTEN
IPv6的程序:
sudo lsof -n -i6TCP:5672 | grep LISTEN
- ss
使用ss显示使用IPv4及其操作系统进程的侦听TCP套接字:
sudo ss --tcp -f inet --listening --numeric --processes
同样,对于使用IPv6的TCP套接字:
sudo ss --tcp -f inet6 --listening --numeric --processes