rhel5中基于SElinux的autofs配置
两台主机:rhel5和server5.
rhel5中使用nfs共享/home,server5作为客户端自动挂载。
在server5上编辑/etc/auto.misc文件,增加一下行:
[root@server5 misc]# vi /etc/auto.misc
#
# $Id: auto.misc,v 1.2 2003/09/29 08:22:35 raven Exp $
#
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
# the following entries are samples to pique your imagination
#linux -ro,soft,intr
#boot -fstype=ext2 :/dev/hda1
#floppy -fstype=auto :/dev/fd0
#floppy -fstype=ext2 :/dev/fd0
#e2floppy -fstype=ext2 :/dev/fd0
#jaz -fstype=ext2 :/dev/sdc1
#removable -fstype=ext2 :/dev/hdd
rhel5 -ro,soft,intr rhel5:/home
这样设置完了后,挂载会不成功的。原因是selinux在搞怪,解决办法如下:
在rhel5主机上使用一下命令,解除selinux对autofs的限制:
[root@server5 misc]#setsebool -P automount_disable_trans on
阅读(1366) | 评论(0) | 转发(0) |