Linux 防火墙,阿里云安全组(上)|学习笔记
开发者学堂课程【Linux 操作系统实战:Linux 防火墙,阿里云安全组(上)】学习笔记,与课程紧密联系,让用户快速学习知识。
课程地址:https://developer.aliyun.com/learning/course/699/detail/12301
Linux 防火墙,阿里云安全组(上)
内容介绍
一、iptables 防火墙
二、firewall 防火墙
配置 Linux 防火墙规则的时候,一定要了解服务器开放的服务并进行正确配置,否则配置不当会影响正常访问服务,甚至不能远程登录管理服务器。
一、iptables 防火墙(Linux 6.x 及以下版本)
1.基本操作
#查看防火墙状态:service iptables status
# 停止防火墙:service iptables stop
# 启动防火墙:service iptables start
# 重启防火墙:service iptables restart
# 永久关闭防火墙:chkconfig iptables off
# 永久关闭后重启:chkconfig iptables on
-
实际操作
(1)登陆服务器,查看版本(cat 命令)
(2)查看具体内容
cat/etc/sysconfig/iptables
包括进入端口、转发端口、输出端口、配置端口的信息。
(3)查看防火墙设置的规则
service iptables status
2.开启80端口:
vim /etc/sysconfig/iptables
#加入如下代码:-A INPUT-m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
#保存退出后重启防火墙:service iptables restart
二、firewall 防火墙(Linux 7.x 及以上版本,8.x 已经和 iptables 解绑)
1.查看 firewall 服务状态:systemctl status firewalld
出现 Active:active(running)切高亮显示则表示是启动状态。
出现 Active:inactive(dead)灰色表示停止。
2.查看 firewall 的状态:firewall-cmd --state
3.开启、重启、关闭 firewalld.service 服务
# 开启:systemctl start firewalld.service
# 重启:systemctl restart firewalld.service
# 关闭:systemctl stop firewalld.service
4.查看防火墙规则:firewall-cmd --list-all
5.查询、开放、关闭端口
# 查询端口是否开放:firewall-cmd --querv-port=8080/tcp
# 开放80端口:f
irewall-cmd --permanent --add-port=80/tcp
# 移除端口:
firewall-cmd --permanent --remove-port=8080/tcp
#重启防火墙(修改配置后要重启防火墙):firewall-cmd --reload
# 参数解释
(1)firwall-cmd:是 Linux 提供的操作 firewall 的一个工具;
(2)--permanent:表示设置为持久;
(3)--add-port:标识添加的端口。
推荐阅读
-
快速学习 YUV 图像的基本处理技巧
-
FFmpeg学习:04.利用FFmpeg将rgb转为yuv
-
解决树莓派4b 64bit上无法使用 Pi Camera V2 的方法
-
10bit YUV(P010)的存储结构和处理-随着计算机处理信息的能力越来越厉害,这种能表现更高动态范围的图像存储格式将会逐渐成为主流,但是现在很多算法都不能直接处理 10bit 的 YUV ,都是先将其转换为 8bit YUV ,然后再进行处理,这实际上是丢弃了 10bit YUV 的图像高动态范围优势。 令人遗憾的是在渲染图像时,目前 OpenGL 也无法直接对 10bit YUV 进行渲染,也是需要先转换为 8bit YUV 。 接下来以一种常见的 10bit YUV (P010) 格式为例,介绍一下 10bit YUV 到 8bit YUV 的转换过程。 P010 最早是微软定义的格式,表示的是 YUV 4:2:0 的采样方式,也就是说 P010 表示的是一类 YUV 格式,它的内存排布方式可能是 NVNVYUYV12 。
-
在am335x上实现SDL移植,以在嵌入式Linux下显示yuv420视频
-
[笔记]音视频学习之视音频数据处理入门《一》YUV、RGB(上)
-
学习如何使用FFmpeg处理YUV格式示例:FFmpeg入门小结(一)
-
利用在线工具学习和练习Lua编程
-
学习猫猫回收站:轻松玩转在线撸猫~
-
轻松学习 uTools 技巧的大型情感类技术连续剧(一)