查看端口centos
时间: 2023-10-19 13:29:55 浏览: 99
端口查看工具
在Centos中,你可以使用以下命令来查看端口情况:
1. 使用netstat命令来查看监听的端口和所有建立的TCP连接:
- `netstat -lntp`:查看监听(Listen)的端口
- `netstat -antp`:查看所有建立的TCP连接
2. 使用lsof命令来查看特定端口的占用情况,比如查看80端口的占用情况:
- `lsof -i tcp:80`:列出所有占用80端口的进程[2]
此外,你还可以使用iptables命令来开启特定端口(以80端口为例):
- `/sbin/iptables -I INPUT -p tcp --dport 80 -j...`:开启80端口
另外,你可以使用chkconfig命令来查看已启用的服务:
- `chkconfig --list|grep 启用`:查看开启的服务<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [centos7查看端口命令](https://blog.csdn.net/weixin_34348111/article/details/91720566)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Centos查看端口占用情况和开启端口命令详解](https://download.csdn.net/download/weixin_38715772/14093989)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文