安装的 /etc/auto_master 的缺省版本会向 –/home 和 /net 项添加 nobrowse 选项。此外,如果尚未修改 /etc/auto_master 中的 /home 和 /net 项,则升级过程还会向这些项中添加 –nobrowse 选项。但是,可能必须手动进行这些更改,或在安装后针对站点特定的 autofs 挂载点关闭浏览功能。
本节介绍如何针对单个客户机、所有客户机以及选定的文件系统关闭浏览功能。
# sharectl set -p nobrowse=TRUE autofs
# svcadm restart system/filesystem/autofs
要针对所有客户机禁用浏览功能,必须使用某个名称服务,如 NIS。否则,需要手动编辑每台客户机上的自动挂载程序映射。在本示例中,/home 目录的浏览功能已禁用。必须对需要禁用的每个间接 autofs 节点遵照以下过程执行操作。
/home auto_home -nobrowse
重新引导后,新行为也会生效。
# /usr/sbin/automount
在本示例中,/net 目录的浏览功能已禁用。对于 /home 或其他任何 autofs 挂载点可以使用同一过程。
name-service/switch 服务中的 config/automount 属性显示了自动挂载信息的搜索顺序。
# svcprop -p config svc:/system/name-service/switch config/value_authorization astring solaris.smf.value.name-service.switch config/printer astring user\ files config/default astring files\ nis config/automount astring files\ nis
最后的项表明将首先搜索本地自动挂载文件,然后才检查 NIS 服务。config/default 项指定了对未明确列出的所有命名信息的搜索顺序。
要使本地文件的添加项优先于名称空间中的项,必须将 +auto_master 项移至 /net 后面。
# Master map for automounter # /net -hosts -nosuid /home auto_home /nfs4 -fedfs -ro,nosuid,nobrowse +auto_master
标准配置将 +auto_master 项放在文件顶部,这样可防止使用任何本地更改。
/net -hosts -nosuid,nobrowse
在客户机系统上运行 automount 命令后或重新引导后,新的行为才会生效。
# /usr/sbin/automount