机器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 yeilds alex
中在NIS服务器上创建文件
如果我在登录到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/阴影中每个用户只有一个条目?这可能是一个不相关的问题,也可能提供有用的信息。
发布于 2014-03-26 18:36:54
我想您是在客户端机器上安装nfsv3,在机器B (nis服务器)上安装nfsv4。
如果使用autofs挂载主目录,则在机器B处添加-nfsvers=3选项
发布于 2014-03-27 15:59:17
古斯塔沃的回答基本上是正确的,但我想我应该补充她的一些细节,而不是作为评论
我在任何地方都被挂载为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目录即使在重新启动之后也无法重新挂载,这造成了一些混乱。
https://serverfault.com/questions/583229
复制相似问题