chown: invalid user: ‘nfsnobody’ in fedora 32 after install nfs

冷暖自知 提交于 2021-01-29 09:27:11

问题


I am install nfs using this command in fedora 32:

sudo dnf install nfs-utils

and then I create a dir to export storage:

[dolphin@MiWiFi-R4CM-srv infrastructure]$ cat /etc/exports
/home/dolphin/data/k8s/monitoring/infrastructure/jenkins *(rw,no_root_squash)

now I could mount this dir with root user like this:

sudo mount -t nfs -o v3 192.168.31.2:/home/dolphin/data/k8s/monitoring/infrastructure/jenkins /mnt

now I want to make a step forward to make it it avaliable to any user from any ip(the client could mount nfs without using sudo), so I first try to chown of this folder:

chown 777 jenkins

and then I want to make this jenkins folder group and user to nfsnobody:

[dolphin@MiWiFi-R4CM-srv infrastructure]$ chown -R nfsnobody jenkins
chown: invalid user: ‘nfsnobody’

and I do not find any nfsnobody content from /etc/passwd. what should I do to fix invalid user: ‘nfsnobody’ problem? should nfs-util added it automatically?


回答1:


Right now nobody used by default probably after RedHat/Centos versions 8

You can simply use

chown -R nobody jenkins

Or

Change it from /etc/idmapd.conf

[Mapping]

Nobody-User = nfsnobody
Nobody-Group = nfsnobody

To put the changes into effect restart the rpcidmapd service and remount the NFSv4 filesystem:

service rpcidmapd restart
mount -o remount /nfs/mnt/point

On Red Hat Enterprise Linux 6, if the above settings have been applied and UID/GID’s are matched on server and client and users are still being mapped to nobody:nobody then a clearing of the idmapd cache may be required.

# nfsidmap -c


来源:https://stackoverflow.com/questions/62980913/chown-invalid-user-nfsnobody-in-fedora-32-after-install-nfs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!