Linux查看所有對外開放的端口
Centos 8查看所有對外開放的端口
查看防火墻對對應(yīng)的端口是否已開啟
firewall-cmd --list-all
方式1
已知服務(wù)使用的端口,查看服務(wù)是否在監(jiān)聽
netstat -anlp | grep 3306
方式二
查詢所有服務(wù)監(jiān)聽的端口
安裝 nmap工具檢測開放端口
1、下載安裝包
http://nmap.org/dist/nmap-7.01.tar.bz2
2、解壓
tar -xvf nmap-7.01.tar.bz2
3、進入目錄執(zhí)行
cd /nmap-7.12
./configure
若報錯“configure: error: no acceptable C compiler found in $PATH”,
說明未安裝gcc,gcc安裝命令為#yum install gcc.
執(zhí)行#make 若報錯“-bash: make: command not found”,
則執(zhí)行#yum install g++或#yum install gcc-c++安裝gcc。
4、make
5、make install
6、查看是否安裝成功
nmap -v
文章來源:http://www.zghlxwxcb.cn/news/detail-527238.html
安裝nmap工具之后,可以通過工具查詢對外開放,并在監(jiān)聽服務(wù)的端口
執(zhí)行:nmap 127.0.0.1
文章來源地址http://www.zghlxwxcb.cn/news/detail-527238.html
Starting Nmap 7.01 ( https://nmap.org ) at 2022-10-10 17:39 CST
Warning: File ./nmap-services exists, but Nmap is using /usr/local/bin/../share/nmap/nmap-services for security and consistency reasons. set NMAPDIR=. to give priority to files in your local directory (may affect the other data files too).
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000010s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
到了這里,關(guān)于Linux查看所有對外開放的端口的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!