安全挂载参数:
mount –t nfs –o nosuid,noexec,nodev,rw 192.168.43.117:/data /mnt
nosuid:不希望共享的存储被执行setuid的功能;
noexec:不希望共享的存储被执行二进制文件;
nodev: 不希望共享的存储创建的设备。
noac:不开启缓存
有人报出一个bug,说使用noac无效,但是使用actimeo=0可以解决这个问题。 验证过,这个选项确实可以解决问题。为了避免频繁的网络请求,我使用actimeo=1
说是这些选项的用途吧:
ac: attribute cache 目的是缓存文件属性信息,防止过于频繁的对nfs服务器的网络请求。(cache时间的长短可以配置,使用man nfs查看)
noac: 也就是不缓存了
ac的时间长短可以通过下面四个选项配置:
acregmin=n The minimum time (in seconds) that the NFS client caches attributes of a regular file before it requests fresh attribute information from a server. If this option is not specified, the NFS client uses a 3-second minimum.
acregmax=n The maximum time (in seconds) that the NFS client caches attributes of a regular file before it requests fresh attribute information from a server. If this option is not specified, the NFS client uses a 60-second maxi-
mum.
acdirmin=n The minimum time (in seconds) that the NFS client caches attributes of a directory before it requests fresh attribute information from a server. If this option is not specified, the NFS client uses a 30-second minimum.
acdirmax=n The maximum time (in seconds) that the NFS client caches attributes of a directory before it requests fresh attribute information from a server. If this option is not specified, the NFS client uses a 60-second maximum.
actimeo=n Using actimeo sets all of acregmin, acregmax, acdirmin, and acdirmax to the same value. If this option is not specified, the NFS client uses the defaults for each of these options listed above.