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 / 问题 / 583229
Accepted
Alex
Alex
Asked: 2014-03-20 11:45:21 +0800 CST2014-03-20 11:45:21 +0800 CST 2014-03-20 11:45:21 +0800 CST

没有 NIS/NFS 的用户/组

  • 772

软件概述

机器 A(NIS 服务器):CentOS 6.2

机器 B :(NFS 服务器) CentoS 6.2

客户端机器: OpenSuse 12.3、CentOS 6.4 和 CentOS 5.6

介绍和设置

机器A是一个 NIS 服务器,它为一组客户端机器提供服务。NIS 映射定义的主目录来自 NFS 服务器(机器B),在登录时会自动挂载。

机器B是使用 NIS 进行身份验证的 NFS 服务器。

当我登录到客户端机器时,我可以读/写我的主目录,其中的所有文件都是

alex users

在许可方面。当我登录 NFS 服务器时也是如此。

但是,当我登录 NIS 服务器时,我的主目录挂载,我可以向其中写入文件,但所有文件都显示为

nobody nobody

获得许可。尽管有这样whoami的结果alex

测试:在 NIS 服务器上的 /home/alex 目录中创建文件

如果我在登录到 NIS 服务器时在我的主目录中创建一个文件

touch /home/alex/testfile 
ls -l testfile # on server

-rw-r--r--. 1 nobody nobody 0 Mar 19 14:21 testfile

但如果我ls -l在客户端机器上运行,我会得到

ls -l testfile # on client machine
-rw-r--r--. 1 alex users 0 Mar 19 14:21 testfile

很明显,文件是作为正确的用户创建的,并且在 NIS 服务器上尊重权限。除了显示我的文件,因为nobody nobody一切看起来都很好,但我担心这可能是更严重的事情的症状。

测试:ypcat命令

登录到 NIS 服务器后,我可以运行

ypcat passwd

并获得输出。

然而ypcat shadow产量

 No such map shadow. Reason: Internal NIS error

但我会认为这是因为我有

MERGE_PASSWD=true

设置在我的/var/yp/Makefile

不需要的密码冗余

作为最后一个奇怪的转折——对于一些用户来说,他们可以使用不再有效的旧密码通过 NIS 登录。我不知道这是怎么发生的,因为 /etc/passwd 和 /etc/shadow 中每个用户只有一个条目?这可能是一个不相关的问题,或者可能提供有用的信息。

permissions
  • 2 2 个回答
  • 5206 Views

2 个回答

  • Voted
  1. Best Answer
    Gustavo Berman
    2014-03-27T10:36:54+08:002014-03-27T10:36:54+08:00

    我猜你是在客户端机器上安装 nfsv3,在机器 B(nis 服务器)上安装 nfsv4

    如果您使用 autofs 挂载主目录,请在机器 B 上添加 -nfsvers=3 选项

    • 1
  2. Alex
    2014-03-28T07:59:17+08:002014-03-28T07:59:17+08:00

    古斯塔沃的回答基本上是正确的,但我想我会添加一些细节而不是作为评论

    我在任何地方都安装为 nsf4,但由于某种原因,nsf4 无法在 NIS 服务器上运行。

    添加defaultvers=3,nfsvers=3到 auto.master 中的挂载线,然后是服务,这样我的 auto.master 文件看起来像这样

    #
    # Sample auto.master file
    # This is an automounter map and it has the following format
    # key [ -mount-options-separated-by-comma ] location
    # For details of the format look at autofs(5).
    #
    /misc   /etc/auto.misc
    #
    # NOTE: mounts done from a hosts map will be mounted with the
    #       "nosuid" and "nodev" options unless the "suid" and "dev"
    #       options are explicitly given.
    #
    /net    -hosts
    #
    # Include central master map if it can be found using
    # nsswitch sources.
    #
    # Note that if there are entries for /net or /misc (as
    # above) in the included master map any keys that are the
    # same will not be seen as the first read key seen takes
    # precedence.
    #
    +auto.master
    /home   yp:auto.home    -rw,hard,bg,rsize=32768,wsize=32768,defaultvers=3,nfsvers=3
    

    随后是 autofs 重启

    service autofs restart
    

    把事情搞定并运行。

    一个随机问题 - 我已经物理登录到我们数据中心的机器但没有注销,因此/home即使重新启动后管理员用户目录也无法重新安装,这引起了一些混乱。

    • 1

相关问题

  • 如何在 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