Ubuntu18.04下安装NFS详细步骤

1.安装NFS服务:

服务器端:sudo apt install nfs-kernel-server

服务器端:sudo apt install portmap(如果安装上一个,可以不用执行此操作)

客户端:sudo apt install nfs-common

2.修改NFS配置文件

    1)配置portmap

sudo vim /etc/default/portmap

-i 127.0.0.1

    2)配 置/etc/hosts.allow

$ sudo vim /etc/hosts.allow

3.配置/etc/exports
    NFS挂载目录及权限由/etc/exports文件定义。
$sudo vim /etc/exports
    比如我要将将我的home目录中的/home/lin/NFSshare目录让192.168.66.*的IP共享, 则在该文件末尾添加下列语句:
        /home/lin/NFSshare  192.168.66.*(rw,sync,no_root_squash)
      然后保存退出。

4.重启nfs服务

$ sudo /etc/init.d/nfs-kernel-server restart

猜你喜欢

转载自blog.csdn.net/lilifang_2011/article/details/112990663