posts - 110,comments - 5,views - 33470

docker进入容器:
docker exec -it xxx /bin/bash           xxx是容器名 或者容器id

查看指定的端口
sudo lsof -i:port

查看所有端口
sudo netstat -aptn

 

使用 Linux 命令 ss 检查系统中的开放端口列表:

ss -lntu   

用下面的命令检查特定的端口:

# # ss -lntu | grep ':25'

Linux 命令 nmap 检查系统中的开放端口列表

nmap -sTU -O localhost

 

nmap -sTU -O localhost | grep 123         检查特定端口;

用 Linux 命令 lsof 检查系统中的开放端口列表:

 

# lsof -i         
# lsof -i:80  检查特定端口80

 

 

 ---------------------------------------------------------------------------------------------------------

防火墙1:

yum install firewalld 安装firewalld 防火墙

systemctl start firewalld.service 开启服务

systemctl stop firewalld.service 关闭防火墙

systemctl enable firewalld.service 开机自动启动firewall

systemctl disable firewalld.service 关闭开机自动启动firewall

systemctl status firewalld、firewall-cmd --state 查看防火墙状态

firewall-cmd --get-active-zones 获取活动的区域,默认public

firewall-cmd --get-service 获取所有支持的服务

firewall-cmd --query-port=80/tcp  查看某个指定端口;

 

 ---------------------------------------------------------------------------------------------------------

 

防火墙2:
iptables 一种防火墙 ;

 

 

 

 

 

posted on   风潇潇兮-Missmen-zy  阅读(25)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示