RPC 身份验证错误

问题描述 投票:0回答:10

上周我使用了 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

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

希望你能帮助我。 格茨·斯特凡

authentication rpc
10个回答
15
投票

此错误与 rpcbind 相关,因此您应该像这样停止服务 portmap:

sudo -i service portmap stop

然后

sudo -i rpcbind -i -w

结束时启动服务端口映射:

sudo -i service portmap start

4
投票

我意识到这是一个较旧的线程,但 Google 发现它位于前 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 处于强制模式,这可能就不是问题了。我仍然需要测试这个理论。

祝你好运。


3
投票

使更改在 Ubuntu12.04 上持久化 (假设使用 -i 运行 rpcbind 的安全影响是不相关的):

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

3
投票

另一个解决方案:CentOS 7.3版本

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

rpcbind : ALL : allow
mountd : ALL : allow

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


0
投票

到目前为止,这里提出的解决方案对我从 Debian Squeeze 到 Wheezy 的升级都不起作用。

就我而言,我唯一要做的就是用“rpcbind”替换 /etc/hosts.allow 中所有出现的“portmapper”(或“portmap”,不确定)。就这些。 (否则 ypbind 无法通过 localhost 连接到 rpcbind。)


0
投票

如果使用 iptables 并且它阻止本地主机的 UDP 连接,也会发生这种情况。今天遇到了这个。停止 iptables,连接开始工作。

你需要找出违反规则的规则。


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

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 

为我工作。


0
投票

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

  1. 检查 /etc/hosts.deny 文件。它应该这样说:
  2. rpcbind mountd nfsd statd lockd rquotad:全部
  3. 确保此文件中最后一行有空白。
  4. 检查 /etc/hosts.allow 文件。它应该这样说:
  5. rpcbind mountd nfsd statd lockd rquotad:127.0.0.1 192.168.1.100
  6. 确保此文件中最后一行有空白。

(对我来说)“技巧”是文件中的空白最后一行。


0
投票

在我的例子中,在 NFS 服务器 /etc/hosts.allow 文件中添加以下条目后,能够在 NFS 客户端上挂载 NFS 文件系统 (nfsclient.example.com 192.168.1.100)

vi /etc/hosts.allow 
mountd : LOCAL nfsclient.example.com 192.168.1.100
© www.soinside.com 2019 - 2024. All rights reserved.