linux开启nfs服务器

1.安装命令

sudo apt-get install nfs-kernel-server portmap

2. 配置路径

vi打开exports文件

sudo vi /etc/exports

增加第13行代码,指定nfs服务器路径向文件夹/home/nanty/linux/nfs(需创建此文件夹)

  1 # /etc/exports: the access control list for filesystems which may be exporte    d
  2 #       to NFS clients.  See exports(5).
  3 #
  4 # Example for NFSv2 and NFSv3:
  5 # /srv/homes       hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_    subtree_check)
  6 #
  7 # Example for NFSv4:
  8 # /srv/nfs4        gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check)
  9 # /srv/nfs4/homes  gss/krb5i(rw,sync,no_subtree_check)
 10 #
 11 
 12 
 13 /home/nanty/linux/nfs *(rw,sync,no_root_squash)

3重启服务

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

你可能感兴趣的:(linux)