博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu16.04安装nfs网络文件系统服务器
阅读量:4041 次
发布时间:2019-05-24

本文共 867 字,大约阅读时间需要 2 分钟。

Ubuntu16.04安装nfs网络文件系统服务器

1. 安装nfs

     $ sudo apt-get install nfs-kernel-server    安装服务器程序

     $ sudo apt-get install nfs-common          安装客户端程序

2. 创建共享目录

    $ mkdir  ~/test

3. 配置nfs

    配置文件为 /etc/exports 文件,打开添加下面一行:

    /home/***/test  *(rw,root_squash,anonuid=1001,anongid=1001,no_subtree_check,sync)

        rw                       挂载该目录的客户端对该目录具有读写权限;

        root_squash        客户端用户是root用户时,将root用户映射为匿名用户anonymous的权限(默认)

        anonuid              指定匿名用户的uid

        anongid              指定匿名用户的gid

        no_subtree_check    不检查父目录的权限

        sync  修改同步写入内存和磁盘

    另外nfs还有其他配置参数,请根据需求添加:

        ro                             read-only 只读权限

        no_root_squash        不将root用户映射为匿名用户

        all_squash                 不论登录用户是什么,都映射为匿名用户

        secure                       数据通过1024以下的安全TCP/IP端口发送

        insecure                    数据通过1024以上的端口发送

        wdelay                      如果有多个用户要写入,则归组写入

        no_wdelay                如果有多个用户要写入,立即写入,当使用async时,无需此设置

        hide                          共享目录不共享其子目录

        no_hide                    共享目录共享器子目录(默认)

        subtree_check           强制检查父目录权限

        async                        修改暂存于内存中,不直接写入磁盘

4. 重启nfs

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

5. 客户端挂载

        sudo mount -t nfs  192.168.1.123:/home/***/test    nfs-client

转载地址:http://kzadi.baihongyu.com/

你可能感兴趣的文章
js判断数组内是否有重复值
查看>>
js获取url链接携带的参数值
查看>>
gdb 调试core dump
查看>>
gdb debug tips
查看>>
arm linux 生成火焰图
查看>>
linux和windows内存布局验证
查看>>
linux insmod error -1 required key invalid
查看>>
linux kconfig配置
查看>>
linux不同模块completion通信
查看>>
linux printf获得时间戳
查看>>
C语言位扩展
查看>>
linux dump_backtrace
查看>>
linux irqdebug
查看>>
git 常用命令
查看>>
linux位操作API
查看>>
uboot.lds文件分析
查看>>
uboot start.s文件分析
查看>>
没有路由器的情况下,开发板,虚拟机Ubuntu,win10主机,三者也可以ping通
查看>>
本地服务方式搭建etcd集群
查看>>
安装k8s Master高可用集群
查看>>