配置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.)
[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

rhce 第十题 配置NFS服务的更多相关文章

  1. RHEL5.8配置NFS服务

    机器配置:4C+16GB 操作系统:RedHat Enterprise Linux 5.8 NFS基础 NFS(Network File System)是Linux系统之间使用最为广泛的文件共享协议, ...

  2. [转]Ubuntu下配置NFS服务

    [转]Ubuntu下配置NFS服务  http://blog.163.com/liu8821031%40126/blog/static/111782570200921021253516/ Table ...

  3. CentOS 6.5配置nfs服务

    CentOS 6.5配置nfs服务 网络文件系统(Network File System,NFS),一种使用于分散式文件系统的协议,由升阳公司开发,于1984年向外公布.功能是通过网络让不同的机器.不 ...

  4. 配置NFS服务与tftp服务

    在VMware在安装ubuntu的图解 链接:http://pan.baidu.com/s/1jIofvYu 密码:da72 图解里已经解压安装了VMware Tools,接下来必须要安装的就是NFS ...

  5. CentOS7系列--3.1CentOS7中配置NFS服务

    CentOS7配置NFS服务 1. 配置NFS服务器端 1.1. 安装nfs-utils软件 [root@server1 ~]# yum install -y nfs-utils Loaded plu ...

  6. (转)Centos7安装配置NFS服务和挂载

    Centos7安装配置NFS服务和挂载 原文:https://www.u22e.com/601.html NFS简介 NFS(Network File System)即网络文件系统,是FreeBSD支 ...

  7. Linux 笔记 - 第二十一章 配置 NFS 服务

    一.前言 NFS(Network File System,网络文件系统),主要功能是通过网络(一般是局域网)让不同的主机系统之间可以共享文件或目录.NFS 客户端(一般为应用服务器,例如web)可以通 ...

  8. ubuntu 14.04LTS 环境下配置NFS服务

    简言之,NFS(Network FileSystem,网络文件系统)用于在不同机器,不同操作系统之间通过网络互相分享各自的文件.NFS设计之初就是为了在不同的系统间使用,所以它的通讯协议设计与主机及操 ...

  9. 配置NFS服务

    1. NFS配置,需要安装哪些包?nfs-utils  和 rpcbind2. 如果不开启rpcbind服务,就启动NFS,会怎么样?如果不开启rpcbind服务,会报错:rpc.nfsd: writ ...

随机推荐

  1. 继承LinearLayout自定义左侧菜单

    public class LeftMenuView extends LinearLayout { LinkedHashMap<Integer,String> map=new LinkedH ...

  2. NPOI 导出Excel部分

    ) { MessageBox.Show("没有找到相关的数据!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.I ...

  3. Centos7修改默认网卡名(改为eth0)以及网卡启动报错RTNETLINK answers: File exists处理

    安装好centos7版本的系统后,发现默认的网卡名字有点怪,为了便于管理,可以手动修改.下面对centos7版本下网卡重命名操作做一记录:1)编辑网卡信息[root@linux-node2~]# cd ...

  4. 【01】团饱和图:(一)EHM定理

    团饱和图:(一)EHM定理 据A. Hajnal考证,术语"饱和性",即saturation,最早由前苏联数学家A. A. Zykov在1949年引入,用于研究线性复形,但是他的工 ...

  5. .net core2.2

    GetCurrentDirectory returns the worker directory of the process started by IIS rather than the app's ...

  6. 自学大数据(hadoop)小插曲__虚拟机工具

    安装VMware Tools VMware 版本:10.0.1 ubuntu(linux) 版本:16.04 LTS 序言:本来第一天可以访问共享文件夹,第二天重新安装了四个ubuntu,可惜确无法访 ...

  7. Eclipse 上传 删除 下载 分析 hdfs 上的文件

    本篇讲解如何通过Eclipse 编写代码去操作分析hdfs 上的文件. 1.在eclipse 下新建Map/Reduce Project项目.如图:  项目建好后,会默认加载一系列相应的jar包. 下 ...

  8. Angular6 Observable.fromEvent error: “Invalid event target”

    今天在angular6项目中写了个拖拽功能,但是控制台报错,如图 后来在控制台打出发现,原来是 ngOnInit( ) 这个生命周期里,页面的dom节点还未产生,还只是null. 改为用 ngAfte ...

  9. zk开机自动启动脚本

    [Unit] Description=Zookeeper service After=network.target [Service] User=www Group=www SyslogIdentif ...

  10. windows环境下安装rabbitmq及配置可视化管理界面

    1.环境 windows7 64位 rabbitmq3.7.9 erlang10.22.先安装erlang,后安装rabbitmq.下载地址: rabbitmq http://www.rabbitmq ...