RPC身份验证错误

时间:2012-10-28 18:51:41

标签: authentication rpc

上周我使用的是RPC,可以正常运行我的RPC服务器程序。但是,今天我尝试再次启动它,我收到了这个错误:

  

无法注册服务:RPC:身份验证错误;为什么=客户   凭证太弱无法注册(X_PROG,X_VERS,udp)

有人能告诉我这个错误的原因是什么吗?

rpcinfo给了我这个:

   program version netid     address                service    owner
    100000    4    tcp6      ::.0.111               portmapper superuser
    100000    3    tcp6      ::.0.111               portmapper superuser
    100000    4    udp6      ::.0.111               portmapper superuser
    100000    3    udp6      ::.0.111               portmapper superuser
    100000    4    tcp       0.0.0.0.0.111          portmapper superuser
    100000    3    tcp       0.0.0.0.0.111          portmapper superuser
    100000    2    tcp       0.0.0.0.0.111          portmapper superuser
    100000    4    udp       0.0.0.0.0.111          portmapper superuser
    100000    3    udp       0.0.0.0.0.111          portmapper superuser
    100000    2    udp       0.0.0.0.0.111          portmapper superuser
    100000    4    local     /run/rpcbind.sock      portmapper superuser
    100000    3    local     /run/rpcbind.sock      portmapper superuser

奇怪的是,过去一周我甚至都没有使用过这款电脑。 是否有任何应该运行的服务?

希望你能帮助我。 Grtz Stefan

9 个答案:

答案 0 :(得分:14)

此错误与rpcbind相关联,因此您应该像这样停止服务端口映射:

sudo -i service portmap stop

然后

sudo -i rpcbind -i -w

在结束时启动服务portmap:

sudo -i service portmap start

答案 1 :(得分:4)

我意识到这是一个较旧的主题,但谷歌发现它在前3个结果中,人们仍在发现nfs服务错误。即使是Red Hat的RHN修复工作也没有用。

截至2013年12月,在RHEL 6.4(x64)上,并且截至2013年11月进行了修补,唯一的解决方案是更改tcp_wrapper配置文件的权限。因为我们已经相当大地保护了这个盒子,所以我们在/etc/hosts.allow和/etc/hosts.deny上拥有640的权限,这两者都由root:root拥有。我们确实试过给这些文件不同的组所有权没有纠正nfs启动时的问题。

一旦我们把烫发放回到开箱即用的状态" (644)nfs(rquotad)服务按预期启动。或者,如果我们完全移动hosts.allow / deny。

要弄清楚多么痛苦。如果我早点看,selinux日志可能会有所帮助。

现在如果我们在执行模式中离开了selinux,这可能不是问题。我仍然需要测试这个理论。

祝你好运。

答案 2 :(得分:3)

在Ubuntu12.04上进行持久更改 (假设使用-i运行rpcbind的安全隐含无关紧要):

echo 'OPTIONS="-w -i"' | sudo tee /etc/default/rpcbind
sudo service portmap restart

答案 3 :(得分:0)

到目前为止,这里提供的所有解决方案都不适用于Debian Squeeze to Wheezy升级。

在我的情况下,我唯一需要做的就是用“rpcbind”替换/etc/hosts.allow中所有出现的“portmapper”(或“portmap”,不再确定)。这就是全部了。 (否则ypbind无法通过localhost连接到rpcbind。)

答案 4 :(得分:0)

如果使用iptables并且它阻止了localhost的UDP连接,也会发生这种情况。今天进入这个。停止iptables,连接开始工作。

你需要找出破坏它的规则。

答案 5 :(得分:0)

我认为值得一提的是,如果你看到如下错误:

0-rpc-service: Could not register with portmap

它可能与hosts.allow和hosts.deny文件集相关,并且缺少hosts.allow文件中localhost的权限。

使用GlusterFS设置NFS时遇到了这种问题。

在我的/etc/hosts.allow文件中,我添加了:

ALL: 127.0.0.1 : ALLOW

并且使用portmap注册服务的问题消失了,一切正常。

注意:使用GlusterFS,请记住重启glusterd服务

/etc/init.d/glusterd restart

答案 6 :(得分:0)

我在rhel7上收到了类似的错误:

ypserv: Cannot register service: RPC: Authentication error; why = Client credential too weak  

启动ypbind时。我尝试了一切,包括上面的'-i'rpcbind。最后,XTaran提到修改/etc/hosts。允许添加此行:

rpcbind: 127.0.0.1 

为我工作。

答案 7 :(得分:0)

又一个解决方案:CentOS 7.3版

除了rpcbind之外,我还必须在/etc/hosts.allow中允许mountd:

rpcbind : ALL : allow
mountd : ALL : allow

这最终让我不仅可以执行rpcinfo,还可以执行showmount和mount。

答案 8 :(得分:0)

FWIW,这是一个“替代”解决方案。

  1. 检查/etc/hosts.deny文件。应该说:
  2. rpcbind mountd nfsd statd lockd rquotad:ALL
  3. 确保此文件中有一个空白的最后一行。
  4. 检查/etc/hosts.allow文件。应该说:
  5. rpcbind mountd nfsd statd lockd rquotad:127.0.0.1 192.168.1.100
  6. 确保此文件中有一个空白的最后一行。
  7. “技巧”(对我来说)是文件中的空白最后一行。