如何关掉Selinux,错误,iconfig :commod not found,关防火墙命令

 

在新版本中的Red Hat 和 Fedora 上,修改档案/etc/sysconfig/selinux:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
 
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
 

把 SELINUX设定为disable, 下次启动系统后将会停止SElinux。

遇到的问题是,我只能看虚拟机共享文件 /mnt/hgfs出现了错误

我可以查看,但是不能像共享文件夹中复制和创建文件,可以进行向外的复制,用不能更新共享文件夹的内容更贴切。

每一次的操作,都会有selinux的一次响应,查看它的打印日志


Summary:

SELinux is preventing updatedb (locate_t) "getattr" to /mnt/hgfs (unlabeled_t).

Detailed Description:

SELinux denied access requested by updatedb. It is not expected that this access
is required by updatedb and this access may signal an intrusion attempt. It is
also possible that the specific version or configuration of the application is
causing it to require additional access.

Allowing Access:

Sometimes labeling problems can cause SELinux denials. You could try to restore
the default system file context for /mnt/hgfs,

restorecon -v '/mnt/hgfs'

If this does not work, there is currently no automatic way to allow this access.
Instead, you can generate a local policy module to allow this access - see FAQ
(http://fedora.redhat.com/docs/selinux-faq-fc5/#id2961385) Or you can disable
SELinux protection altogether. Disabling SELinux protection is not recommended.
Please file a bug report (http://bugzilla.redhat.com/bugzilla/enter_bug.cgi)
against this package.

Additional Information:

Source Context                system_u:system_r:locate_t:s0
Target Context                system_u:object_r:unlabeled_t:s0
Target Objects                /mnt/hgfs [ dir ]
Source                        updatedb
Source Path                   /usr/bin/updatedb
Port                          <Unknown>
Host                          localhost.localdomain
Source RPM Packages           mlocate-0.20-1
Target RPM Packages          
Policy RPM                    selinux-policy-3.3.1-42.fc9
Selinux Enabled               True
Policy Type                   targeted
MLS Enabled                   True
Enforcing Mode                Enforcing
Plugin Name                   catchall_file
Host Name                     localhost.localdomain
Platform                      Linux localhost.localdomain 2.6.25-14.fc9.i686 #1
                              SMP Thu May 1 06:28:41 EDT 2008 i686 i686
Alert Count                   2
First Seen                    Tue 14 Feb 2012 05:06:37 PM CST
Last Seen                     Wed 15 Feb 2012 02:24:37 PM CST
Local ID                      e63344c1-0d63-4fd5-a7c3-15390f7fda74
Line Numbers                 

Raw Audit Messages           

host=localhost.localdomain type=AVC msg=audit(1329287077.371:43): avc:  denied  { getattr } for  pid=12623 comm="updatedb" path="/mnt/hgfs" dev=vmhgfs ino=1 scontext=system_u:system_r:locate_t:s0 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir

host=localhost.localdomain type=SYSCALL msg=audit(1329287077.371:43): arch=40000003 syscall=196 success=no exit=-13 a0=8706c89 a1=bfe8f148 a2=ccbff4 a3=bfe8f2c8 items=0 ppid=12617 pid=12623 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="updatedb" exe="/usr/bin/updatedb" subj=system_u:system_r:locate_t:s0 key=(null)

根据它的指示尝试了,

restorecon -v '/mnt/hgfs'

并不好使,
接着,按照上面所说的关掉Selinux,问题解决。

selinux简介
SElinux在linux内核级别上提供了一个灵活的强制访问控制系统(MAC),这个强制访问控制系统是建立在自由访问控制系统(DAC)之上的。
DAC是指系统的安全访问控制都是由系统管理员root自由管理的,不是系统强制行为MAC运行的时候,比如一个应用程序或者一个线程以某个用户UID或者SUID运行的时候同样对一些其他的对象拥有访问控制限制,比如文件,套接子(sockets)或者其他的线程通过运行SElinux
MAC内核可以保护系统不受到恶意程序的侵犯,或者系统本身的bug不会给系统带来致命影响(把影响限定在一定范围内)SElinux为每一个用户,程序,进程,还有文件定义了访问还有传输的权限。然后管理所有这些对象之间的交互关系。
对于SELinux设定的对象全限是可以根据需要在安装时候规定严格程度,或者完全禁用
在大多数情况下,SElinux对于用户来说是完全透明的,普通用户根本感觉不到Selinux的存在,只有系统管理员才需要对这些用户环境,以及策略进行考虑。这些策略可以按照需要宽松的部署或者应用严格的限制,Selinux提供了非常具体的控制策略,范围覆盖整个linux系统
比如,当一个对象如应用程序要访问一个文件对象,内核中的控制程序检查访问向量缓存(AVC),从这里寻找目标和对象的权限,如果在这里没有发现权限定义,则继续查询安全定义的上下关联,以及文件权限,然后作出准许访问以及拒绝访问的决定。如果在var/log/messages出现avc:
denied信息,则表明访问拒绝。
目标和对象通过安装的策略来决定自身的安全关联,同时这些安装的策略也负责给系统产生安全列表提供信息。
除了运行强制模式以外,SELinux可以运行在许可模式,这时候,检查AVC之后,拒绝的情况被记录。Selinux不强制使用这种策略.
以下介绍一下SELinux相关的工具

 

 

问题2,

安装完系统后,使用ifconfig时产生错误commond  not  found

输入命令:ln                  -s           /sbin/ifconfig                    /usr/bin/ifconfig
问题3,

mount: RPC: Unable to receive; errno = No route to host

这是nfs挂载时候出现的错误信息

原因是PC端防火墙没有关闭

service iptables stop

运行该命令关闭防火墙。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值