当前位置: 首页 > wzjs >正文

河南电商网站设计管理员网站后台上传本地视频

河南电商网站设计,管理员网站后台上传本地视频,cms网站开发框架,汽车网站营销文章目录 一、SELinux安全上下文1、SELinux简介(1)概念(2)核心思想(3)工作模式 2、基础操作命令(1)查看SELinux状态(2)切换工作模式 3、安全上下文&#xff0…

文章目录

  • 一、SELinux安全上下文
    • 1、SELinux简介
      • (1)概念
      • (2)核心思想
      • (3)工作模式
    • 2、基础操作命令
      • (1)查看SELinux状态
      • (2)切换工作模式
    • 3、安全上下文(Security Context)
      • (1)查看上下文
      • (2)修改上下文
  • 二、Linux防火墙-Firewalld
    • 1、概述
    • 2、Linux防火墙
      • (1)防火墙结构
      • (2)firewalld防火墙
      • (3)firewall-cmd命令用法

一、SELinux安全上下文

1、SELinux简介

(1)概念

​ SELinux(Security-Enhanced Linux)是Linux内核的**强制访问控制(MAC)**安全子系统,提供更细粒度的权限控制,防止进程或用户越权操作。

(2)核心思想

  • 最小权限原则:进程/用户只能访问其明确需要的资源。
  • 基于标签的访问控制:所有资源(文件、端口、进程)被赋予安全上下文(Security Context)。

(3)工作模式

模式描述
Enforcing强制执行策略,拒绝非法操作并记录日志。
Permissive仅记录违规操作,不阻止(用于调试)。
Disabled完全关闭SELinux(需重启生效)。

2、基础操作命令

(1)查看SELinux状态

[root@localhost ~]# getenforce
Enforcing

(2)切换工作模式

[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
[root@localhost ~]# setenforce 1
[root@localhost ~]# getenforce
Enforcing

注意:setenforce仅临时生效,永久修改需编辑 /etc/selinux/config 文件。

3、安全上下文(Security Context)

(1)查看上下文

ls -Z 查看文件/目录的上下文

[root@localhost ~]# ls -Z
unconfined_u:object_r:admin_home_t:s0 公共  unconfined_u:object_r:admin_home_t:s0 下载
unconfined_u:object_r:admin_home_t:s0 模板  unconfined_u:object_r:admin_home_t:s0 音乐
unconfined_u:object_r:admin_home_t:s0 视频  unconfined_u:object_r:admin_home_t:s0 桌面
unconfined_u:object_r:admin_home_t:s0 图片      system_u:object_r:admin_home_t:s0 anaconda-ks.cfg
unconfined_u:object_r:admin_home_t:s0 文档

ps -Z -C nginx 查看进程的上下文

[root@localhost ~]# ps -Z -C nginx
LABEL                               PID TTY          TIME CMD
system_u:system_r:httpd_t:s0      97984 ?        00:00:00 nginx
system_u:system_r:httpd_t:s0      97985 ?        00:00:00 nginx
system_u:system_r:httpd_t:s0      97986 ?        00:00:00 nginx
system_u:system_r:httpd_t:s0      97987 ?        00:00:00 nginx
system_u:system_r:httpd_t:s0      97988 ?        00:00:00 nginx

(2)修改上下文

chcon命令

-t 设置安全上下文的类型部分

-u 设置安全上下文的用户部分

-r 设置安全上下文的角色部分

–reference 使用指定文件的安全上下文

-R 递归处理文件和目录

-h 显示帮助信息

二、Linux防火墙-Firewalld

1、概述

按表现形式划分:

​ 软件防火墙: 集成在系统内部,Linux系统: iptables、firewalld、ufw; windows系统下: windows defender

​ 硬件防火墙: 华为防火墙、思科防火墙、奇安信防火墙、深信服防火墙等

按技术划分:

​ 包过滤防火墙: 检查数据包的源IP、目的IP、源端口、目的端口、TCP的syn控制位

​ 七层防火墙:除了上述检查外,还会检查数据内容

防火墙的作用:

​ 阻止来自网络外部的攻击、进行流量控制

2、Linux防火墙

(1)防火墙结构

用户态:

iptables: 使用iptables命令对防火墙规则进行管理,必须深度理解网络技术和四表五链,对于初学者或者网络技术不达标的人员不友好

​ **firewalld:**使用firewall-cmd命令对防火墙进行管理,采用的是区域划分的形式。不需要连接底层的四表五链,对于初学者比较友好

ufw: 使用ufw命令对防火墙进行管理,命令简单易懂。

内核态:

四表: 从内核->用户的顺序: raw -> mangle -> nat -> filter

五链: input、output、forward、prerouting、postrouting

(2)firewalld防火墙

区域分类: block、dmz、drop、external、home、internal、public、trusted、work

区域功能:

public:公共区域,默认区域

public (active)target: defaulticmp-block-inversion: nointerfaces: ens160sources: services: cockpit dhcpv6-client sshports: protocols: forward: yesmasquerade: noforward-ports: source-ports: icmp-blocks: rich rules:

home: 家庭区域

[root@localhost ~]# firewall-cmd --zone=home --list-all
hometarget: defaulticmp-block-inversion: nointerfaces: sources: services: cockpit dhcpv6-client mdns samba-client sshports: protocols: forward: yesmasquerade: noforward-ports: source-ports: icmp-blocks: rich rules: 

work: 工作区域

[root@localhost ~]# firewall-cmd --zone=work --list-all
worktarget: defaulticmp-block-inversion: nointerfaces: sources: services: cockpit dhcpv6-client sshports: protocols: forward: yesmasquerade: noforward-ports: source-ports: icmp-blocks: rich rules:

block: 堵塞区域

[root@localhost ~]# firewall-cmd --zone=block --list-all
blocktarget: %%REJECT%%icmp-block-inversion: nointerfaces: sources: services: ports: protocols: forward: yesmasquerade: noforward-ports: source-ports: icmp-blocks: rich rules:

drop: 丢弃区域

root@localhost ~]# firewall-cmd --zone=drop --list-all
droptarget: DROPicmp-block-inversion: nointerfaces: sources: services: ports: protocols: forward: yesmasquerade: noforward-ports: source-ports: icmp-blocks: rich rules: 

trusted:完全信任区域

[root@localhost ~]# firewall-cmd --zone=trusted --list-all
trustedtarget: ACCEPTicmp-block-inversion: nointerfaces: sources: services: ports: protocols: forward: yesmasquerade: noforward-ports: source-ports: icmp-blocks: rich rules:

internal:内部区域

[root@localhost ~]# firewall-cmd --zone=internal --list-all
internaltarget: defaulticmp-block-inversion: nointerfaces: sources: services: cockpit dhcpv6-client mdns samba-client sshports: protocols: forward: yesmasquerade: noforward-ports: source-ports: icmp-blocks: rich rules: 

external:外部区域

[root@localhost ~]# firewall-cmd --zone=external --list-all
externaltarget: defaulticmp-block-inversion: nointerfaces: sources: services: sshports: protocols: forward: yesmasquerade: yesforward-ports: source-ports: icmp-blocks: rich rules: 

dmz: 非军事化管理区域

root@localhost ~]# firewall-cmd --zone=dmz --list-all
dmztarget: defaulticmp-block-inversion: nointerfaces: sources: services: sshports: protocols: forward: yesmasquerade: noforward-ports: source-ports: icmp-blocks: rich rules: 

(3)firewall-cmd命令用法

--list-*
--get-*
--set-*
--add-*
--remove-*
--change-*
--zone=
http://www.dtcms.com/wzjs/812680.html

相关文章:

  • 建设银行注册网站首页森马网站建设情况
  • 嘉兴南湖区建设局网站手机百度app
  • 安吉网站制作汽车品牌推广方案
  • 网站开发要会英语吗做网站主要注意些什么
  • 西安中交建设集团网站wordpress图床
  • 单位不能建设网站丹灶网站建设公司
  • 微信网站开发制作平台wordpress 微博主题 twitter主题
  • 正一品网站建设全网营销推广运营培训学校
  • 网站上传发生一个ftp错误什么是网络营销?
  • 怎么用百度云做网站空间女性时尚网站模板
  • 网站建设保障措施简易购物网站模板
  • 国外物流公司网站模板中国大基建最新消息
  • 中国服装设计网站手机宣传网站
  • 携程企业网站建设的思路苏州建网站哪家
  • 多平台网站开发重庆万州网站建设哪家好
  • p2p贷款网站开发周村有做网站广告的吗
  • 建设项目安监备案网站做网站还是订阅号
  • d网站建设的目的网站中英文切换前端
  • 长春电商网站建设哪家专业如何创建微信小程序下单
  • 教育机构网站源码wordpress 高仿 主题
  • 参与网站网站建设可判几年网站开发时遇到的问题
  • 安阳网站优化个人博客网站的建设结构图
  • 网站毕业设计答辩问题goule wordpress
  • 校园电商平台网站建设河南新闻
  • 平面设计公司vi设计整站优化方案
  • 凡科轻站小程序怎么样2345网址导航怎么彻底删掉win10
  • 广东省建设项目安全标准自评网站有专门做房孑特卖的网站吗
  • 网站中文域名续费是什么情况app企业签名
  • wordpress博客视频教程哈西建站优化
  • 最简约的网站机箱做的网站主机怎么查看ftp