nfs的基本用法
来源:互联网 发布:软件产品类别是什么 编辑:程序博客网 时间:2024/06/06 07:01
#######nfs####
1.启用服务
yum install nfs-utils -y ##安装服务systemctl enable nfs-server
systemctl start nfs-server ##启动服务
systemctl start firewalld ##开启火墙,并进行策略配置
firewall-cmd --permanent --add-service=nfs
firewall-cmd --permanent --add-service=rpc-bind
firewall-cmd --permanent --add-service=mountd
firewall-cmd --reload ##刷新火墙策略
[root@localhost ~]# firewall-cmd --list-all
public (default, active)
interfaces: eth0 eth1
sources:
services: dhcpv6-client mountd nfs rpc-bind ssh
ports:
masquerade: no
forward-ports:
icmp-blocks:
rich rules:
服务端测试结果:
showmount -e 172.25.254.106
Export list for 172.25.254.106:
2.共享目录
mkdir /public ##建立共享目录chmod 777 /public
vim /etc/exports ##编辑配置文件,格式如下
/public *(sync) ##该目录共享给所有人,且数据同步
/public 172.25.6.0/24(sync) ##该目录共享给172.25.6.0/24网段
/public *.example.com(sync) ##共享给example.com域的所有主机
/public 172.25.6.11(ro,sync) 172.25.6.250(rw,sync) ##共享给11是只读,250是读写
/public *(sync,no_root_squash) ##客户端使用root挂载,执行操作身份为root
/public *(sync,anonuid=1001,anongid=1000) #对共享目录执行操作以1001为uid,1000为gid
测试结果:
3.保护nfs的证书认证
在server端
[root@server6 ~]# yum install sssd krb5-workstation authconfig-gtk -y[root@server6 ~]# authconfig-gtk ##编辑配置
开启kerberos认证,得到ldap用户
[root@server6 ~]# wget http://172.25.254.254/pub/keytabs/server6.keytab -O /etc/krb5.keytab ##获得证书
[root@server6 ~]# ktutil ##测试证书下载是否正确
ktutil: rkt /etc/krb5.keytab
ktutil: list
[root@server6 ~]# systemctl enable nfs-secure-server
[root@server6 ~]# mkdir /public
[root@server6 ~]# touch /public/hello{1..2}
[root@server6 ~]# vim /etc/exports ##编辑nfs配置文件
[root@server6 ~]# exportfs -rv ##使配置生效
exporting *:/public
在desktop端
[root@desktop6 ~]# yum install sssd krb5-workstation authconfig-gtk -y[root@desktop6 ~]# authconfig-gtk
[root@desktop6 ~]# wget http://172.25.254.254/pub/keytabs/desktop6.keytab -O /etc/krb5.keytab
[root@desktop6 ~]# ktutil
ktutil: rkt /etc/krb5.keytab
ktutil: list
[root@desktop6 ~]# systemctl restart nfs-secure
[root@desktop6 ~]# systemctl enable nfs-secure
阅读全文
0 0
- nfs的基本用法
- nfs的基本设定
- UBUNTU下NFS的基本配置
- rpm的基本用法
- sfc的基本用法
- vi 的基本用法
- JProgressBar 的基本用法
- NPlot的基本用法
- JAR的基本用法
- tar的基本用法
- MessageBox的基本用法
- LIKE的基本用法
- sfc的基本用法
- CListCtrl的基本用法
- cc的基本用法
- IDHttp的基本用法
- FpSpread的基本用法
- MySql的基本用法
- 《初恋50次》附百度云盘链接
- Unsupported Media Type 415问题解决办法(Ajax)
- 剑指offer——旋转数组的最小数字(二分法思路)
- 【Python】引用和对象的理解
- 前端框架大比拼:Angularjs vs Reactjs vs Vue.js
- nfs的基本用法
- design包中的tablayout的使用
- 浅谈程序猿简历的写法,你会如何写你的简历呢?
- HDU1023 Train Problem 卡特兰数
- 使用JetBrains IntelliJ IDEA创建Jython项目:环境配置与代码示例
- windows bat命令
- 并发使用的时机
- jquery的遍历方法可以获取复选框所欲的选中值
- py-faster-rcnn详解(5)——stage1_rpn_train.pt说明