zoukankan      html  css  js  c++  java
  • rhce 第十题 配置NFS服务

    配置NFS服务

    在system1配置NFS服务,要求如下:

    •  以只读的方式共享目录/public,同时只能被group8.example.com域中的系统访问
    •  以读写的方式共享目录/protected,同时只能被group8.example.com域中的系统访问
    •  访问/proteaced需要通过Kerberos安全加密,您可以使用下面URL提供的秘钥http://server.group8.example.com/pub/keytabs/system1.keytab
    •  目录/protected应该包含名为project拥有人为andres的子目录
    •  用户andres能以读写的方式访问/protected、project

    在system1上执行
    1、安装服务,并设定开启启动

    [root@system1 ~]# yum install nfs-utils -y (模拟考试实验环境不需要安装,安装就会升级到7.2)
    [root@system1 ~]# systemctl enable nfs-server nfs-secure-server
    ln -s '/usr/lib/systemd/system/nfs-server.service' '/etc/systemd/system/nfs.target.wants/nfs-server.service'
    ln -s '/usr/lib/systemd/system/nfs-secure-server.service' '/etc/systemd/system/nfs.target.wants/nfs-secure-server.service'

    2、设置防火墙规则

    [root@system1 ~]# firewall-cmd --permanent --add-service=nfs
    success
    [root@system1 ~]# firewall-cmd --permanent --add-service=rpc-bind
    success
    [root@system1 ~]# firewall-cmd --permanent --add-service=mountd
    success
    [root@system1 ~]# firewall-cmd --reload
    success

    3、设定目录及SElinux安全上下文

    [root@system1 ~]# mkdir -p /public
    [root@system1 ~]# mkdir -p /protected/project
    [root@system1 ~]# chown andres /protected/project/
    [root@system1 ~]# semanage fcontext -a -t 'public_content_t' '/project(/.*)?'
    [root@system1 ~]# semanage fcontext -a -t 'public_content_rw_t' '/project/project(/.*)?'
    [root@system1 ~]# restorecon -Rv /protected/
    [root@system1 ~]# restorecon -Rv /protected/project/

    4、下载kerberos证书

    [root@system1 ~]# wget -O /etc/krb5.keytab http://server.group8.example.com/pub/keytabs/system1.keytab

    5、编辑nfs资源导出配置文件

    [root@system1 ~]# vim /etc/exports
        /public *.group8.example.com(insecure,ro,sec=sys,sync)
        /protected      *.group8.example.com(insecure,rw,sec=krb5p,sync)

    6、修改nfs启动参数,并重启服务

    [root@system1 ~]# vim /etc/sysconfig/nfs 
    ...
    RPCNFSDARGS="-V 4.2"
    ...
    [root@system1 etc]# systemctl restart nfs-server nfs-secure-server

    7、刷新并导出资源

    [root@system1 etc]# exportfs -ra
    [root@system1 etc]# exportfs 
    /public           *.group8.example.com
    /protected        *.group8.example.com
  • 相关阅读:
    886C. Petya and Catacombs#墓室探险(set集合)
    uc/os调度机制深度解析
    总结使用QObject实现线程
    日常总结--c++常量的深入理解
    数据结构与算法--跳跃链表
    java下输出中文的一点研究
    java使用readUTF()读取中文抛出EOFException异常的处理方法
    java连接5.1以上的mysql出现问题---The server time zone value '???ú±ê×??±??' is unrecognized or represents more than one time zone.
    Qt入门便遇到坑--向QMainWindow类及其子类中添加布局
    linux_4.19内核编译总结
  • 原文地址:https://www.cnblogs.com/despotic/p/10691980.html
Copyright © 2011-2022 走看看