我刚刚解决了一个类似的问题。我想/home/username
从nfs挂载一些用户的目录,但在本地磁盘上还有其他几个。不幸的是,在尝试使用本地磁盘目录时,我遇到了权限错误。
经过一番研究,我man auto.master 5
仔细阅读了一下,发现了这一点:
For direct maps the mount point is always specified as:
/-
and the key used within the direct map is the full path to the
mount point. The direct map may have multiple entries in the master map.
Run Code Online (Sandbox Code Playgroud)
所以,在 auto.master 中,你会有这样的一行:
/- auto.misc --timeout 60
Run Code Online (Sandbox Code Playgroud)
在 auto.misc 中:
/home/remoteuser <options> <nfsserver>:<path to home dir>
Run Code Online (Sandbox Code Playgroud)
如果需要,您仍然可以在 auto.misc 文件中进行间接安装。只取决于您想如何组织地图文件。
请注意,这是在 Ubuntu 16.04 和自动挂载 5.1.1 上。我还没有在其他操作系统上测试过这个。