linux挂载nfs显示nobady,CentOS-6.x配置NFS时,客户端UID显示为nobody的解决办法

CentOS6.x的NFS配置跟CentOS5.x不太一样,不光是安装包及服务名变了,还总有各种古怪的事情,今天遇到了NFS客户端mount NFS之后目录的属主变成了nobody:nobody,折腾了半天,终于找到了解决办法:

本次案例:

OS: CentOS-6.5

NFS Server: 192.168.100.101 nfsserver.sudops.com

NFS Client: 192.168.100.102 nfsclient.sudops.com

服务端配置:

# cat /etc/exports

/data/storage 192.168.100.0/255.255.255.0(rw,sync,all_squash,anonuid=0,anongid=0)

# cat /etc/idmapd.conf

[General]

#Verbosity = 0

# The following should be set to the local NFSv4 domain name

# The default is the host's DNS domain name.

#Domain = local.domain.edu

1

2

3

4

5

6

7

8

9

# cat /etc/exports

/data/storage192.168.100.0/255.255.255.0(rw,sync,all_squash,anonuid=0,anongid=0)

# cat /etc/idmapd.conf

[General]

#Verbosity = 0

# The following should be set to the local NFSv4 domain name

# The default is the host's DNS domain name.

#Domain = local.domain.edu

改成

[General]

#Verbosity = 0

# The following should be set to the local NFSv4 domain name

# The default is the host's DNS domain name.

#Domain = local.domain.edu

Domain = sudops.com

1

2

3

4

5

6

[General]

#Verbosity = 0

# The following should be set to the local NFSv4 domain name

# The default is the host's DNS domain name.

#Domain = local.domain.edu

Domain=sudops.com

重启NFS服务端

# /etc/init.d/nfs restart

# /etc/init.d/rpcbind restart

# /etc/init.d/rpcidmapd restart

1

2

3

# /etc/init.d/nfs restart

# /etc/init.d/rpcbind restart

# /etc/init.d/rpcidmapd restart

客户端配置:

跟服务端一样也要修改/etc/idmapd.conf

重启客户端应用

# /etc/init.d/rpcbind restart

# /etc/init.d/rpcidmapd restart

1

2

# /etc/init.d/rpcbind restart

# /etc/init.d/rpcidmapd restart

重新mount

# umount -l /local/storage

# mount -t nfs 192.168.100.101:/data/storage/ /local/storage

1

2

# umount -l /local/storage

# mount -t nfs 192.168.100.101:/data/storage/ /local/storage

这次终于跟NFS的export目录属主保持一致啦!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值