首页 技术 正文
技术 2022年11月15日
0 收藏 534 点赞 4,735 浏览 1477 个字

[root@localhost targeted]# pwd
/etc/selinux/targeted
[root@localhost targeted]# getsebool -a|grep samba
samba_create_home_dirs –> off
samba_domain_controller –> off
samba_enable_home_dirs –> off
samba_export_all_ro –> off
samba_export_all_rw –> off
samba_run_unconfined –> off
samba_share_fusefs –> off
samba_share_nfs –> off
use_samba_home_dirs –> off
virt_use_samba –> off
[root@localhost targeted]# setsebool samba_create_home_dirs on

chcon

关闭SELinux的方法:
  修改/etc/selinux/config文件中的SELINUX=”” 为 disabled ,然后重启。
  如果不想重启系统,使用命令setenforce 0
注:
setenforce 1 设置SELinux 成为enforcing模式
setenforce 0 设置SELinux 成为permissive模式
  在lilo或者grub的启动参数中增加:selinux=0,也可以关闭selinux

#—————————————————————
查看selinux状态:
/usr/bin/setstatus -v
如下:
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: permissive
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted

getenforce/setenforce查看和设置SELinux的当前工作模式。

Linux关闭防火墙

1) 重启后永久性生效:

  开启: chkconfig iptables on

  关闭: chkconfig iptables off

  2) 即时生效,重启后失效:

  开启: service iptables start

  关闭: service iptables stop

  需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。

  在开启了防火墙时,做如下设置,开启相关端口,

  修改/etc/sysconfig/iptables 文件,添加以下内容:

  -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT

  -A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 22 -j ACCEPT

  或者:

  /etc/init.d/iptables status 会得到一系列信息,说明防火墙开着。

  /etc/rc.d/init.d/iptables stop 关闭防火墙

建议的关闭防火墙命令是

  iptables -P INPUT ACCEPT

  iptables -P FORWARD ACCEPT

  iptables -P OUTPUT ACCEPT

  iptables -F

注:
fedora下:

  /etc/init.d/iptables stop

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,082
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,557
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,406
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,179
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,815
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,898