嵌入式linux下挂载nfs出现permission denied的解决方法

2019-07-13 09:08发布

一直都能用mount -t nfs [hostip]:/opt/nfs /mnt将主机上的nfs挂载 后来VMware8死机,导致windows死机,重启,VM中的redhat5就坏了 还好曾经snapshot了一下:)))   后来在嵌入式linux下mount时,就不断报错“permission denied” 搞了许久,才发现是忘了这一步“服务器端在文件/etc/exports中设定允许被访问的文件、目录以及访问的权限” so 修改/etc/exports 文件,添加如下内容
/opt/nfs *(rw,sync,no_root_squash,no_all_squash) 运行以下命令启动nfs 服务:
Host #/usr/sbin/exportfs –a
Host #/sbin/service nfs restart   over~~