selinux

How to set SELinux to 0 or permissive mode in android 4.4.4 and above?

怎甘沉沦 提交于 2019-11-30 23:15:08
问题 I want to set the SELinux (Security Enhanced Linux) mode to Permissive or (0) on android 4.4.4 (and above if possible). I use the following command: setenforce 0 , setenforce permissive and setenforce Permissive under root (my device is rooted). But the output of getenforce is always Enforcing . Now I am exhausted with this problem. Can any one give me a solution? Thanks in advance. 回答1: Apparently Google has removed the CONFIG_SECURITY_SELINUX_DEVELOP kernel flag from many of their Stock

centOS7 LAMP安装及注意要点

十年热恋 提交于 2019-11-30 19:21:37
在VM下安装了centos7体验一下,首先安装一下LAMP环境,如下: 安装LAMP环境: 1、apache2 # yum install -y httpd # systemctl start httpd.service 启动 # systemctl enable httpd.service 开机自动启动 # vi /etc/httpd/conf/httpd.conf 默认配置文件 # systemctl restart httpd.service 重启 2、mysql # wget http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm centOS最小安装,wget没有安装 # yum install -y wget # rpm -ivh mysql-community-release-el7-5.noarch.rpm # yum install mysql-community-server 成功安装之后重启mysql服务 # service mysqld restart 3、 php5.6 # yum install --enablerepo=remi --enablerepo=remi-php56 php php-opcache php-pecl-apcu php-devel php

firewall和netfilter

时光总嘲笑我的痴心妄想 提交于 2019-11-30 18:00:52
firewall和netfilter 临时关闭防火墙 selinux 使用命令 setenforce 0 如果想永久关闭防火墙,需要修改配置文件 配置文件地址是 /etc/selinux/config 可以使用 vi /etc/selinux/config 进行修改 如图,打开config文件后,可以看到上图内容 这里需要把 SELINUX=enforcing 的值 修改为 disabled 也就是 SELINUX=disabled ,然后保存退出,重启系统就生效了 如图,命令 getenforce 可以查看 selinux 的状态 上图显示为 Enforcing 表示是打开状态 使用 setenforce 0 命令把 selinux 临时关闭 然后再使用 getenforce 查看 selinux 的状态 可以看到变成了 Permissive Permissive的意思是,一些会触发防火墙的操作,系统会提出警告 如果是 Enforcing 状态,系统会直接打断操作 而 Permissive 状态下,系统不会打断操作,但是会在后台记录警告信息 也就是说,可以进行一些会触发 selinux 的操作 除了selinux这个防火墙外,还有另外一个防火墙叫做 netfilter selinux防火墙是对内的,而 netfilter 是对外的 网络过来的包会被netfilter处理

centos7离线安装docker

我们两清 提交于 2019-11-30 16:09:01
1.下载docker安装包 在https://download.docker.com/linux/centos/7/x86_64/stable/Packages/下载docker-ce-17.03.0.ce-1.el7.centos.x86_64.rpm 下载9个依赖 在http://mirrors.163.com/centos/7/os/x86_64/Packages/下载8个依赖 在http://rpm.pbone.net/index.php3?stat=3&limit=1&srodzaj=1&dl=40&search=container-selinux&field[]=1&field[]=2下载container-selinux-2.9-4.el7.noarch.rpm 3.安装 将8个依赖复制到服务器上如:/root/docker/ rpm -ivh audit-libs-python-2.7.6-3.el7.x86_64.rpm --nodeps rpm -ivh checkpolicy-2.5-4.el7.x86_64.rpm --nodeps rpm -ivh libcgroup-0.41-13.el7.x86_64.rpm --nodeps rpm -ivh libseccomp-2.3.1-3.el7.x86_64.rpm --nodeps rpm -ivh

centos 7 搭建 LNMP ( Linux+Nginx+MySQL+PHP )

孤者浪人 提交于 2019-11-30 14:43:25
操作系统 | CentOS Linux release 7.6.1810 (Core) [root@localhost ~# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) 更新时间同步 [root@localhost ~]# sudo yum install ntp ntpupdate -y [root@localhost ~]# sudo systemctl start ntpd [root@localhost ~]# timedatectl set-timezone "Asia/Shanghai" [root@localhost ~]# systemctl enable ntpd [root@localhost ~]# ntpdate cn.pool.ntp.org [root@localhost ~]# sudo systemctl restart ntpd [root@localhost ~]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime [root@localhost ~]# clock --systohc [root@localhost ~]# hwclock -w [root@localhost ~]# date '+%Y/

centos7 samba服务器的配置

£可爱£侵袭症+ 提交于 2019-11-30 13:16:43
[global] workgroup = WORKGROUP server string = Samba Server %v netbios name = centos security = user map to guest = bad user dns proxy = no #============================ Share Definitions ============================== [Anonymous] path = /samba/anonymous browsable =yes writable = yes guest ok = yes read only = no 如果windows下登录samba服务器后无法访问linux下共享目录,提示没有权限。 则检查 a、确保linux下防火墙关闭或者是开放共享目录权限 b、确保samba服务器配置文件smb.conf设置没有问题,可网上查阅资料看配置办法 c、确保setlinux关闭,可以用setenforce 0命令执行。 默认的,SELinux禁止网络上对Samba服务器上的共享目录进行写操作,即使你在smb.conf中允许了这项操作。 /usr/bin/setenforce 修改SELinux的实时运行模式 setenforce 1 设置SELinux

Configuring SELinux permissions on (SVS-V) IPC Semaphores

拟墨画扇 提交于 2019-11-30 12:21:01
I have a bunch of programs which use IPC Semaphores to interact (semget). One of the programs is an Apache module, which runs in (some sort of) restricted SELinux context (which I don't understand too well). The module is capable of interacting with any regular files correctly, if of-course the files have their SELinux security context set appropriately. However - when my (Module) goes to access the IPC Semaphore, the semget call fails with a EPERM. When SELinux is turned off, I don't get this error. So - there is obviously something I need to do to set some sort of SELinux security context or

CentOS7下配置Nginx

匆匆过客 提交于 2019-11-30 09:38:56
背景 最近倒腾服务器的时候,选择了CentOS7操作系统,在安装配置Nginx的时候遇到了Permission Denied问题。按照chown和chmod进行配置无果,后来定位到SELinux问题。 SELinux是什么? When you upgrade a running system to Red Hat Enterprise Linux (RHEL) 6.6 or CentOS 6.6, the Security Enhanced Linux (SELinux) security permissions that apply to NGINX are relabelled to a much stricter posture. Although the permissions are adequate for the default configuration of NGINX, configuration for additional features can be blocked and you need to permit them explicitly in SELinux. This article describes the possible issues and recommended ways to resolve them. Nginx安装 按照如下配置

四种解决Nginx出现403 forbidden 报错的方法

▼魔方 西西 提交于 2019-11-30 09:38:32
我是在在本地用虚拟机中通过yum安装nginx的,安装一切正常,但是访问时报403, 于是查看nginx日志,路径为/var/log/nginx/error.log。打开日志发现报错Permission denied,详细报错如下: 1. open() "/data/www/1.txt" failed (13: Permission denied), client: 192.168.1.194, server: www.web1.com, request: "GET /1.txt HTTP/1.1", host: "www.web1.com" 没有权限?于是找了不少资料,可以通过下面四步排查解决此问题。你可能只是其中之前配置有问题,不一定四个步骤都用上。 一、由于启动用户和nginx工作用户不一致所致 1.1查看nginx的启动用户,发现是nobody,而为是用root启动的 命令:ps aux | grep "nginx: worker process" | awk'{print $1}' 1.2将nginx.config的user改为和启动用户一致, 命令:vi conf/nginx.conf 二、缺少index.html或者index.php文件,就是配置文件中index index.html index.htm这行中的指定的文件。 1. server { 2. listen

zabbix4.2Proxy安装文档

痴心易碎 提交于 2019-11-30 09:27:25
zabbix4.2Proxy 安装文档 目录 zabbix4.2Proxy安装文档 1 一、安装 2 1、前期安装准备 2 2、安装zabbix RPM源 3 2.1下载zabbix RPM源包 3 2.2安装zabbix RPM源包 3 3、安装zabbix组件(zabbix-proxy、zabbix-agent) 4 4、安装mysql数据库,导入zabbix数据库 5 4.1安装mysql数据库 5 4.2安装mysql-server 7 4.3安装完成后启动服务,并将mysql服务设置为开机启动。 8 4.4初始化mysql 9 4.5创建zabbix数据库,并授权 10 4.6导入zabbix数据库 11 5、配置zabbix 12 5.1配置zabbix配置文件 12 5.2启动服务 13 5.3排错 13 二、web端配置zabbix代理 15 1、web配置zabbix代理 15 2、排错 17 一、安装 1、前期安装准备 前期准备一个大一点的分区准备用于zabbix 数据库的存放,为方便后期扩容,我们在这里选择新加一个磁盘并以LVM的方式进行挂载(此处省略虚拟机添加硬盘等操作) # df -h,看到新盘已经挂载到VAR/LIB/MYSQL目录了 替换yum源 刚安装好的Centos自带的yum源是无法使用的,要替换成国内的YUM源 # mv /etc/yum