学习笔记七: security

简介:

一 openssh相关操作


   ssh用于远程连接服务器


  1. 配置ssh不需要验证密码登录


2.  禁止root密码ssh登录


3.


二 filewalld配置

  它是基于linux内核的netfilter网络防火墙,限制网络访问资源,它可以修改进入,出去或转发的包,来保护系统,防止非法入侵。rhel6是iptables,rhel7后,命名为filewalld

默认filrewalld定义了如下几个区域:
trusted

home

internal

work

public

external

dmz

block

drop


配置工具有:

firewall-config

firewall-cmd



  1. filrewall基本配置举例


firewall-cmd --set-default-zone=dmz

firewall-cmd --permanent --zone=internal --add-source=192.168.0.0/24

firewall-cmd --reload



firewall-cmd --set-default-zone public


firewall-cmd --permanent --zone=public --list-all


firewall-cmd --permanent --zone=public --add-port 8080/tcp




三 selinux


1.查看selinux状态

getenforce


2.设置selinux状态

getsebool -a

setenforce 0


3.设置默认的selinux

/etc/selinux/config

SELINUX=disabled


4.更改SELiunx目录

ls -Zd /var/www/html

restorecon


chcon 

chcon -t httpd_sys_content_t /virtual


restorecon -v /virtual


5.设置SELinux 默认文件目录规则

semanage fcontext -l


restorecon -Rv /var/www/




getsebool -a | grep home

setsebool -P httpd_enable_homedirs on



本文转自 woshiwei201 51CTO博客,原文链接:http://blog.51cto.com/chenwei/1841964


相关文章
|
18天前
|
安全 Java 数据安全/隐私保护
Security快速入门
Security快速入门
|
18天前
|
安全 数据安全/隐私保护
security权限管理详解
security权限管理详解
|
安全 Java 数据安全/隐私保护
Spring Security中permitAll()和anonymous()的区别
anonymous() 允许匿名用户访问,不允许已登入用户访问 permitAll() 不管登入,不登入 都能访问 permitAll(): Always evaluates to true isAnonymous(): Returns true if the current principal is an anonymous user
688 0
|
存储 算法 安全
Security2 3|学习笔记
快速学习 Security2 3
61 0
Security2 3|学习笔记
|
缓存 安全 Java
Security2 1|学习笔记
快速学习 Security2 1
203 0
Security2 1|学习笔记
|
自然语言处理 算法 安全
Security2.2|学习笔记
快速学习 Security2.2
100 0
Security2.2|学习笔记
|
存储 安全 Java
Security1 2|学习笔记
快速学习 Security1 2
90 0
Security1 2|学习笔记
|
安全 Java 数据安全/隐私保护
案例之认证服务security配置|学习笔记
快速学习案例之认证服务security配置
73 0
案例之认证服务security配置|学习笔记
|
存储 前端开发 安全
Security RememberMe原理分析
Security RememberMe原理分析
156 0
|
安全 NoSQL Java
security和oauth2.0的整合
security和oauth2.0的整合 之前已经介绍过security的相关的介绍,现在所需要做的就是security和oauth2.0的整合,在原有的基础上我们加上一些相关的代码;代码实现如下: pom.
1511 0