chown:安装 nfs 后,fedora 32 中的用户无效:“nfsnobody" [英] chown: invalid user: ‘nfsnobody’ in fedora 32 after install nfs

查看:545
本文介绍了chown:安装 nfs 后,fedora 32 中的用户无效:“nfsnobody"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 fedora 32 中使用这个命令安装 nfs:

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)

现在我可以像这样用 root 用户挂载这个目录:

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

现在我想向前迈出一步,让它对任何 ip 的任何用户都可用(客户端可以在不使用 sudo 的情况下挂载 nfs),所以我首先尝试 chown 这个文件夹:

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

然后我想将此 jenkins 文件夹组和用户设置为 nfsnobody:

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’

而且我在 /etc/passwd 中没有找到任何 nfsnobody 内容.我应该怎么做才能解决 invalid user: ‘nfsnobody’ 问题?nfs-util 应该自动添加吗?

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?

推荐答案

现在没人默认使用,可能在 RedHat/Centos 8 版之后使用

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

你可以简单地使用

chown -R nobody jenkins

或者

从/etc/idmapd.conf 更改它

Change it from /etc/idmapd.conf

[Mapping]

Nobody-User = nfsnobody
Nobody-Group = nfsnobody

要使更改生效,请重新启动 rpcidmapd 服务并重新挂载 NFSv4 文件系统:

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

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

在 Red Hat Enterprise Linux 6 上,如果已应用上述设置并且 UID/GID 在服务器和客户端上匹配,并且用户仍被映射到 nobody:nobody,则可能需要清除 idmapd 缓存.

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

这篇关于chown:安装 nfs 后,fedora 32 中的用户无效:“nfsnobody"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆