系统管理指南:网络服务

Procedure如何在选定的文件系统上禁用 Autofs 浏览功能

在本示例中,/net 目录的浏览功能已禁用。对于 /home 或其他任何 autofs 挂载点可以使用同一过程。

  1. 检查 /etc/nsswitch.conf 中的 automount 项。

    要使本地文件项具有较高的优先级,名称服务切换文件中的项应将 files 列在名称服务之前。例如:


    automount:  files nisplus

    此项会显示标准 Solaris 安装中的缺省配置。

  2. 检查 /etc/auto_master+auto_master 项的位置。

    除使本地文件优先于名称空间中的项以外,还必须将 +auto_master 项移至 /net 后面:


    # Master map for automounter
    
    #
    
    /net    -hosts     -nosuid
    
    /home   auto_home
    
    /xfn    -xfn
    
    +auto_master
    

    标准配置会将 +auto_master 项置于文件的顶部。此放置方式可防止使用任何本地更改。

  3. /etc/auto_master 文件中的 /net 项添加 nobrowse 选项。


    /net     -hosts     -nosuid,nobrowse
    
  4. 在所有客户机上运行 automount 命令。

    在客户机系统上运行 automount 命令后或重新引导后,新的行为才会生效。


    # /usr/sbin/automount