AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 591143
Accepted
baumgart
baumgart
Asked: 2014-04-24 04:07:01 +0800 CST2014-04-24 04:07:01 +0800 CST 2014-04-24 04:07:01 +0800 CST

AIX 上的 NFSv4 权限

  • 772

我正在尝试在两个不共享 UID/GID 的系统上使用 NFSv4 挂载。这是针对旧环境使用任何可用的 UID/GID 的系统迁移,它们现在在新环境上发生冲突。我已经在新环境中为所有用户提供了新的非冲突 ID。

我的问题是 NFS 挂载。我正在尝试使用 NFSv4,因为它将 ID 作为字符串而不是数字(这应该有助于映射)传递。我可以在旧环境上安装一个文件系统,当我执行 时ls -l,我在两边都看到了正确的名称(因此映射正在工作)。

当我尝试以用户身份(两个系统上都存在具有不同 UID 的用户)触摸文件时,我的权限被拒绝。用户是两个系统上适当组的成员(该组在两个环境中具有不同的 GID,但用户是双方的适当成员)。

还有其他选项可以解决我的问题(使用 NFSv3 和重新映射 UID/GID),但如果可以避免的话,我不想这样做。


这是我的配置和一些测试,向您展示我所看到的......

服务器配置:

# chnfsdom
Current local domain: red.act.ed
# cat /etc/exports
/usr/sap/trans -vers=4,sec=sys,rw,root=172.29.4.56:172.29.4.55:172.29.4.65
# ls -ld /usr/sap/trans/data
drwxrwxr-x    2 d01adm   sapsys       118784 Apr 23 08:25 /usr/sap/trans/data
# ls -nld /usr/sap/trans/data
drwxrwxr-x    2 300      300          118784 Apr 23 08:25 /usr/sap/trans/data

客户端配置:

# chnfsdom
Current local domain: red.act.ed
# mount | grep trans
devbox   /usr/sap/trans   /usr/sap/trans   nfs4   Apr 23 09:01 vers=4
qabox:/ # ls -ld /usr/sap/trans/data
drwxrwxr-x    2 d01adm   sapsys       118784 Apr 23 09:25 /usr/sap/trans/data
qabox:/ # ls -nld /usr/sap/trans/data
drwxrwxr-x    2 8        14           118784 Apr 23 09:25 /usr/sap/trans/data

根据该信息,UID/GID 翻译似乎工作正常。这是摩擦(在客户端盒子上)......

qabox:q01adm> pwd
/usr/sap/trans
qabox:q01adm> ls -ld .
drwxrwxr-x   14 d01adm   sapsys         4096 Apr 23 09:56 .
qabox:q01adm> id
uid=12(q01adm) gid=14(sapsys) groups=0(system),7(security),4294967294(nobody),15(oper),16(dba)
qabox:q01adm> touch file
touch: 0652-046 Cannot create file.

这是我可以在同一个客户端上使用 root 执行的操作:

qabox:/usr/sap/trans # pwd
/usr/sap/trans
qabox:/usr/sap/trans # id
uid=0(root) gid=0(system) groups=2(bin),3(sys),7(security),8(cron),10(audit),11(lp),14(sapsys)
qabox:/usr/sap/trans # touch file
qabox:/usr/sap/trans # chown q01adm:sapsys file
qabox:/usr/sap/trans # ls -l file
-rw-r--r--    1 q01adm   sapsys            0 Apr 23 09:59 file
qabox:/usr/sap/trans # ls -nl file
-rw-r--r--    1 12       14                0 Apr 23 09:59 file

在服务器盒子上,我看到了这个:

# ls -l /usr/sap/trans/file
-rw-r--r--    1 q01adm   sapsys            0 Apr 23 08:59 /usr/sap/trans/file
# ls -nl /usr/sap/trans/file
-rw-r--r--    1 302      300               0 Apr 23 08:59 /usr/sap/trans/file

所以,从我所看到的一切......UID/GID 转换工作正常,我只是不能在客户端以非 root 用户身份写入文件。

permissions
  • 1 1 个回答
  • 4243 Views

1 个回答

  • Voted
  1. Best Answer
    user1686
    2014-04-24T08:14:54+08:002014-04-24T08:14:54+08:00

    根据我有限的知识,NFSv4 ID 映射仅适用于通过 NFS 本身发送的 stat() 结果和其他信息——即,由orchown返回的文件所有者等。lsstat

    但是,身份验证由较低级别(SunRPC)处理,它仍然在默认的 AUTH_UNIX 协议中使用您的数字 UID。因此,如果您是本地用户 #12,那么服务器也将收到该用户。

    为避免这种情况,您需要一种支持用户名的身份验证机制;Kerberos (AUTH_GSS) 可能是这里唯一的选择。

    • 2

相关问题

  • 如何在 Exchange 2007 中设置资源邮箱日历的忙/闲权限?

  • 共享文件夹中某些文件的访问被拒绝错误

  • Bash 脚本:要求脚本以 root 身份运行(或使用 sudo)

  • 如何授予用户安装 Windows 服务的能力?

  • 限制用户向电子邮件地址发送电子邮件

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve