Linux查看系统版本以及防火墙常用命令

1. 查看操作系统版本信息

1)  查看版本当前操作系统内核信息:uname -a   

x86_64版本为:

ARM版本 为:

2) 查看当前操作系统版本信息:cat /proc/version  

3) 查看cpu信息:cat /proc/cpuinfo    (自行grep过滤)

4)  查看内存信息:cat /proc/meminfo    (自行grep过滤)

5) 查看版本32/64位: getconf LONG_BIT

6) 查看发行Centos版本:

# cat /etc/redhat-release

2. firewall防火墙常用命令

1) 查看firewall服务状态

# systemctl status firewalld

出现Active: active (running)且高亮显示则表示是启动状态。

出现 Active: inactive (dead)灰色表示停止,看单词也行。

2) 关闭防火墙

service firewalld stop

3) 开启防火墙

service firewalld start

4) 重启防火墙

service firewalld restart

5)  查询端口是否开放(需开启防火墙查看)

firewall-cmd --query-port=8080/tcp

6) 开放80端口

firewall-cmd --permanent --add-port=80/tcp

7) # 移除端口

firewall-cmd --permanent --remove-port=8080/tcp

3.  iptables防火墙常用命令

1) 查看防火墙状态

service iptables status  

2) 停止防火墙

service iptables stop  

3) 启动防火墙

service iptables start  

4) 重启防火墙

service iptables restart  

5) 永久关闭防火墙

chkconfig iptables off  

6) 永久关闭后重启

chkconfig iptables on  

 

  • 0
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值