处理Centos5.5 x64 配置NFS服务过程中nfsnobody用户造成的问题
今天使用 Centos5.5 64位的系统部署一个NFS服务器之后,使用客户端进行挂载,遇到了权限不足的问题,以下把我的排错过程和问题处理过程和各位分享。如果您在配置NFS服务器的过程中,遇到了同样的问题,希望这篇blog对您有所帮助。
环境:
NFS服务器IP:192.168.60.3 使用CentOS 5.5 x64操作系统
NFS客户端IP:192.168.60.4 使用CentOS 5.5 x64操作系统
NFS服务配置过程
1、查看确认一下,当前NFS服务器的NFS服务和RPC服务的状态
[root@NFS ~]# chkconfig --list |grep 3:on (查看目前开机启动的服务)
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sysstat 0:off 1:off 2:on 3:on 4:off 5:on 6:off
[root@NFS ~]# /etc/init.d/portmap status (查看一下,portmap启动没有)
portmap is stopped
[root@NFS ~]# /etc/init.d/nfs status (查看一下,NFS启动没有)
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped
2、由于两个服务都没有启动,并且没有设置开机启动,所以我们进行一下配置
[root@NFS ~]# chkconfig nfs on (设置NFS服务开机启动)
[root@NFS ~]# chkconfig portmap on (设置portmap服务器开机启动)
[root@NFS ~]# chkconfig --list |grep 3:on (确认一下修改生效了)
network 0:off 1:off 2:on 3:on 4:on 5:on 6:off
nfs 0:off 1:off 2:on 3:on 4:on 5:on 6:off
portmap 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off
sysstat 0:off 1:off 2:on 3:on 4:off 5:on 6:off
3、我们重新启动一下服务器,确认一下上述修改都生效了,服务器启动正常。
[root@NFS ~]# shutdown -r now (重启一下服务器)
[root@NFS ~]# /etc/init.d/nfs status
rpc.mountd (pid 2434) is running...
nfsd (pid 2431 2430 2429 2428 2427 2426 2425 2424) is running...
rpc.rquotad (pid 2398) is running...
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:2049 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:882 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:917 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:7455 0.0.0.0:* LISTEN
tcp 0 0 :::65534 :::* LISTEN
[root@NFS ~]# rpcinfo -p (查看一下RPC注册的端口号)
program vers proto port
100000 2 tcp 111 portmapper
100000 2 udp 111 portmapper
100011 1 udp 879 rquotad
100011 2 udp 879 rquotad
100011 1 tcp 882 rquotad
100011 2 tcp 882 rquotad
100003 2 udp 2049 nfs
100003 3 udp 2049 nfs
100003 4 udp 2049 nfs
100021 1 udp 14392 nlockmgr
100021 3 udp 14392 nlockmgr
100021 4 udp 14392 nlockmgr
100003 2 tcp 2049 nfs
100003 3 tcp 2049 nfs
100003 4 tcp 2049 nfs
100021 1 tcp 7455 nlockmgr
100021 3 tcp 7455 nlockmgr
100021 4 tcp 7455 nlockmgr
100005 1 udp 914 mountd
100005 1 tcp 917 mountd
100005 2 udp 914 mountd
100005 2 tcp 917 mountd
100005 3 udp 914 mountd
100005 3 tcp 917 mountd
[root@NFS ~]# cd / (回到根目录)
[root@NFS /]# ll (查看一下)
total 166
drwxr-xr-x 2 root root 4096 Mar 23 20:52 bin
drwxr-xr-x 4 root root 1024 Mar 23 18:18 boot
drwxr-xr-x 12 root root 4220 May 27 19:42 dev
drwxr-xr-x 84 root root 4096 May 27 20:15 etc
drwxr-xr-x 3 root root 4096 Mar 23 22:26 home
drwxr-xr-x 11 root root 4096 Mar 23 20:52 lib
drwxr-xr-x 7 root root 12288 Mar 23 20:52 lib64
drwx------ 2 root root 16384 Mar 23 18:14 lost+found
drwxr-xr-x 2 root root 4096 Jan 27 2010 media
drwxr-xr-x 2 root root 4096 Mar 31 2010 misc
drwxr-xr-x 2 root root 4096 Jan 27 2010 mnt
drwxr-xr-x 2 root root 4096 Jan 27 2010 opt
dr-xr-xr-x 79 root root 0 May 27 19:41 proc
drwxr-x--- 2 root root 4096 Mar 23 22:24 root
drwxr-xr-x 2 root root 12288 Mar 23 20:52 sbin
drwxr-xr-x 2 root root 4096 Mar 23 18:14 selinux
drwxr-xr-x 2 root root 4096 May 27 20:16 share
drwxr-xr-x 2 root root 4096 Jan 27 2010 srv
drwxr-xr-x 11 root root 0 May 27 19:41 sys
drwxrwxrwt 3 root root 4096 May 27 19:42 tmp
drwxr-xr-x 15 root root 4096 Mar 23 18:16 usr
drwxr-xr-x 20 root root 4096 Mar 23 18:17 var
[root@NFS /]# ll (确认一下所有者和所属组修改好了)
total 166
drwxr-xr-x 2 root root 4096 Mar 23 20:52 bin
drwxr-xr-x 4 root root 1024 Mar 23 18:18 boot
drwxr-xr-x 12 root root 4220 May 27 19:42 dev
drwxr-xr-x 84 root root 4096 May 27 20:33 etc
drwxr-xr-x 3 root root 4096 Mar 23 22:26 home
drwxr-xr-x 11 root root 4096 Mar 23 20:52 lib
drwxr-xr-x 7 root root 12288 Mar 23 20:52 lib64
drwx------ 2 root root 16384 Mar 23 18:14 lost+found
drwxr-xr-x 2 root root 4096 Jan 27 2010 media
drwxr-xr-x 2 root root 4096 Mar 31 2010 misc
drwxr-xr-x 2 root root 4096 Jan 27 2010 mnt
drwxr-xr-x 2 root root 4096 Jan 27 2010 opt
dr-xr-xr-x 77 root root 0 May 27 19:41 proc
drwxr-x--- 2 root root 4096 Mar 23 22:24 root
drwxr-xr-x 2 root root 12288 Mar 23 20:52 sbin
drwxr-xr-x 2 root root 4096 Mar 23 18:14 selinux
drwxr-xr-x 2 nfsnobody nfsnobody 4096 May 27 20:16 share
drwxr-xr-x 2 root root 4096 Jan 27 2010 srv
drwxr-xr-x 11 root root 0 May 27 19:41 sys
drwxrwxrwt 3 root root 4096 May 27 19:42 tmp
drwxr-xr-x 15 root root 4096 Mar 23 18:16 usr
drwxr-xr-x 20 root root 4096 Mar 23 18:17 var
/share 192.168.60.0/24(rw,sync,all_squash,root_squash) (我们允许这个共享对192.168.60.0/24网段可读可写,且将所有访问者包括root的身份都改为nfsnobody)
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
/share 192.168.60.0/24
Export list for 192.168.60.3:
/share 192.168.60.0/24
[root@session ~]# /etc/init.d/portmap start (启动RPC服务)
Starting portmap: [ OK ]
[root@session ~]# mount -t nfs 192.168.60.3:/share /test (再次挂载就成功了)
[root@session ~]# cd /test (进入/test这个NFS目录)
touch: cannot touch `1': Permission denied
[root@NFS /]# ll (确认修改成功了)
total 166
drwxr-xr-x 2 root root 4096 Mar 23 20:52 bin
drwxr-xr-x 4 root root 1024 Mar 23 18:18 boot
drwxr-xr-x 12 root root 4220 May 27 19:42 dev
drwxr-xr-x 84 root root 4096 May 27 20:33 etc
drwxr-xr-x 3 root root 4096 Mar 23 22:26 home
drwxr-xr-x 11 root root 4096 Mar 23 20:52 lib
drwxr-xr-x 7 root root 12288 Mar 23 20:52 lib64
drwx------ 2 root root 16384 Mar 23 18:14 lost+found
drwxr-xr-x 2 root root 4096 Jan 27 2010 media
drwxr-xr-x 2 root root 4096 Mar 31 2010 misc
drwxr-xr-x 2 root root 4096 Jan 27 2010 mnt
drwxr-xr-x 2 root root 4096 Jan 27 2010 opt
dr-xr-xr-x 77 root root 0 May 27 19:41 proc
drwxr-x--- 2 root root 4096 Mar 23 22:24 root
drwxr-xr-x 2 root root 12288 Mar 23 20:52 sbin
drwxr-xr-x 2 root root 4096 Mar 23 18:14 selinux
drwxrwxrwx 2 nfsnobody nfsnobody 4096 May 27 20:16 share
drwxr-xr-x 2 root root 4096 Jan 27 2010 srv
drwxr-xr-x 11 root root 0 May 27 19:41 sys
drwxrwxrwt 3 root root 4096 May 27 19:42 tmp
drwxr-xr-x 15 root root 4096 Mar 23 18:16 usr
drwxr-xr-x 20 root root 4096 Mar 23 18:17 var
total 0
-rw-r--r-- 1 65534 65534 0 May 27 20:42 1
/share 192.168.60.0/24(rw,sync,all_squash,root_squash,anonuid=4294967294,anongid=4294967294)
Shutting down NFS mountd: [ OK ]
Shutting down NFS daemon: [ OK ]
Shutting down NFS quotas: [ OK ]
Shutting down NFS services: [ OK ]
Starting NFS services: [ OK ]
Starting NFS quotas: [ OK ]
Starting NFS daemon: [ OK ]
Starting NFS mountd: [ OK ]
[root@NFS /]# ll (确认修改成功)
total 166
drwxr-xr-x 2 root root 4096 Mar 23 20:52 bin
drwxr-xr-x 4 root root 1024 Mar 23 18:18 boot
drwxr-xr-x 12 root root 4220 May 27 19:42 dev
drwxr-xr-x 84 root root 4096 May 27 20:33 etc
drwxr-xr-x 3 root root 4096 Mar 23 22:26 home
drwxr-xr-x 11 root root 4096 Mar 23 20:52 lib
drwxr-xr-x 7 root root 12288 Mar 23 20:52 lib64
drwx------ 2 root root 16384 Mar 23 18:14 lost+found
drwxr-xr-x 2 root root 4096 Jan 27 2010 media
drwxr-xr-x 2 root root 4096 Mar 31 2010 misc
drwxr-xr-x 2 root root 4096 Jan 27 2010 mnt
drwxr-xr-x 2 root root 4096 Jan 27 2010 opt
dr-xr-xr-x 77 root root 0 May 27 19:41 proc
drwxr-x--- 2 root root 4096 Mar 23 22:24 root
drwxr-xr-x 2 root root 12288 Mar 23 20:52 sbin
drwxr-xr-x 2 root root 4096 Mar 23 18:14 selinux
drwxr-xr-x 2 nfsnobody nfsnobody 4096 May 27 20:42 share
drwxr-xr-x 2 root root 4096 Jan 27 2010 srv
drwxr-xr-x 11 root root 0 May 27 19:41 sys
drwxrwxrwt 3 root root 4096 May 27 19:42 tmp
drwxr-xr-x 15 root root 4096 Mar 23 18:16 usr
drwxr-xr-x 20 root root 4096 Mar 23 18:17 var
[root@session test]# touch 2 (新建一个文件2)
[root@session test]# touch 3 (新建一个文件3)
[root@session test]# ll (查看一下。我们发现写入和用户都正常了)
total 0
-rw-r--r-- 1 65534 65534 0 May 27 20:42 1
-rw-r--r-- 1 nfsnobody nfsnobody 0 May 27 2012 2
-rw-r--r-- 1 nfsnobody nfsnobody 0 May 27 2012 3
##老男孩培训交流群 208160987 226199307 44246017
转载于:https://blog.51cto.com/zywqs/880844
处理Centos5.5 x64 配置NFS服务过程中nfsnobody用户造成的问题相关推荐
- linux nfsnobody用户,处理CentOS 5.5 x64 配置NFS服务过程中nfsnobody用户造成的问题
4.我们编译一下这个NFS的配置文件. [root@NFS /]# vi /etc/exports /share 192.168.60.0/24(rw,sync,all_squash,root_squ ...
- Ubuntu中配置NFS服务
NFS协议允许远程访问Linux主机中的指定目录,并且在Windows 7中,原生支持将NFS文件系统映射到本地,通过资源管理器就可以访问Linux虚拟机或者开发板中的文件,非常方便. Ubuntu中 ...
- 【FAQ】接入HMS Core应用内支付服务过程中一些常见问题总结(2)
HMS Core应用内支付服务(In-App Purchases,IAP)为应用提供便捷的应用内支付体验和简便的接入流程.该服务支持客户端和服务端两种开发形式,具体可以参考官方文档 上次,我们分享和总 ...
- 接入HMS Core应用内支付服务过程中一些常见问题总结
华为HMS Core应用内支付服务(In-App Purchases,IAP)为应用提供便捷的应用内支付体验和简便的接入流程.该服务支持客户端和服务端两种开发形式,具体可以参考官方文档. 往期文章:常 ...
- 一对一直播源码开发,如何改善音视频通话过程中的用户体验?
在一对一直播源码开发中,由于是单个用户对话单个用户,所以对音视频通话质量的要求会比较高,那应该如何在开发时改善音视频通话中的用户体验呢? 一.选择播放模式 在一对一直播源码中视频通话过程中出现马赛克或 ...
- CentOS 6.5系统下安装和配置NFS服务
一.环境介绍: 服务器:centos 192.168.1.225 客户端:centos 192.168.1.226 二.安装: NFS的安装配置: centos 5 : 1 yum -y instal ...
- centos8共享文件夹挂载_CentOS 8 安装并配置NFS服务
NFS 网络文件系统(Network File System)是一种分布式文件系统协议,通过网络共享远程目录.使用NFS,可以在系统上挂载远程目录,并像对待本地文件一样使用远程计算机上的文件. 默认情 ...
- CentOS 8安装并配置NFS服务
先决条件 我们假设您有一台运行CentOS 8的服务器,我们将在该服务器上设置NFS服务器和其他充当NFS客户端的计算机.服务器和客户端应该能够通过专用网络相互通信.如果您的托管服务提供商不提供私有I ...
- 关于svn的安装配置开启服务过程和 eclipse安装SVN插件的方法
eclipse安装SVN插件的方法链接:https://www.cnblogs.com/alamps/p/6155963.html svn的安装配置开启服务相关过程: 安装一直下一步cmd中:echo ...
最新文章
- 对于七段数码数字模型进行改进:一个关键的数字1的问题
- 利用GoogleEarth影像打造Skyline MPT案例(转载)
- 对象创建的过程细节是怎样的?一起来探讨内存变化细节
- ulimit限制 新系统_说来惭愧,我被ulimit摔了一跤...
- LeetCode 684. Redundant Connection
- tornado httpserver
- 汇编常见寄存器以及标志位
- ccf运行错误是什么原因_正压送风机运行中叶轮裂纹产生原因是什么?
- Android Studio 导入/导出项目以及Android Device Monitor导出文件
- 工欲善其事必先利其器——MySQL数据库(2),查询操作
- csdn下载频道资源整理
- 关于《训练指南》中的“翻棋子游戏”
- 大学计算机应用基础教程读后感,计算机应用基础的课程学习体会
- 主机甲和主机乙之间使用后退N帧协议(GBN)传输数据,甲的发送窗口为1000,数据帧长为1000字节,信道带宽为100Mb/s,乙每收到一个数据帧......[数据传输率]错题总结
- ABAP SPLITTER技术总结及使用技巧
- python黑色变白色_在OpenCV python中将白色像素转换为黑色
- 学习C C++的必备技能(1)
- Android项目:基于安卓Android校园零食配送系统app(计算机毕业设计)
- Wallpaper Engine pkg壁纸文件提取工具
- 结队项目——智能订餐系统用户调研报告
热门文章
- Python抓取熊猫TV分类下的主播人气排名
- [医学图像Transformer]TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation
- DDR2内存参数设置
- 时尚竞聘求职简历PPT模板
- win10 22H2优化了大小核吗?
- 河北2022中国农民丰收节 国稻种芯:主会场活动在塔元庄举行
- swagger参数注解,后台使用@RequestBody注解的实体类,但只需要传实体类中的一个属性
- 西门子PLC几种常见的通讯协议分享
- java 算法之插入排序
- 数字电子逻辑复习卷(由于图片无法上传,下附语雀地址)