![加载共享库时出现 Redhat 错误:libkeyutils.so.1:无法打开共享对象文件:权限被拒绝](https://linux22.com/image/80827/%E5%8A%A0%E8%BD%BD%E5%85%B1%E4%BA%AB%E5%BA%93%E6%97%B6%E5%87%BA%E7%8E%B0%20Redhat%20%E9%94%99%E8%AF%AF%EF%BC%9Alibkeyutils.so.1%EF%BC%9A%E6%97%A0%E6%B3%95%E6%89%93%E5%BC%80%E5%85%B1%E4%BA%AB%E5%AF%B9%E8%B1%A1%E6%96%87%E4%BB%B6%EF%BC%9A%E6%9D%83%E9%99%90%E8%A2%AB%E6%8B%92%E7%BB%9D.png)
我刚刚安装并尝试在我的 redhat 7 机器上启动 rpcbind。我是 Linux 新手,所以我在弄清楚下一步该做什么时遇到了一些困难。我以 root 用户身份运行所有这些命令。
当我运行 rpcbind 时,我得到以下输出:
Jan 07 09:44:28 sebilj systemd[1]: Starting RPC bind service...
**Jan 07 09:44:28 sebilj rpcbind[17902]: /sbin/rpcbind: error while loading shared libraries: libkeyutils.so.1: cannot open shared object file: Permission denied**
Jan 07 09:44:28 sebilj systemd[1]: rpcbind.service: control process exited, code=exited status=127
Jan 07 09:44:28 sebilj systemd[1]: Failed to start RPC bind service.
Jan 07 09:44:28 sebilj systemd[1]: Unit rpcbind.service entered failed state.
Jan 07 09:44:28 sebilj systemd[1]: rpcbind.service failed.
所以我检查了一下,有问题的库确实存在,并且它的 chmod 设置为 777 ,所以具有完整的权限。
我检查过,这个库正在链接到一个同名但版本更高的库,并且第二个库也具有完全权限:
ldconfig -v | grep libkeyutils.so.1
libkeyutils.so.1 -> libkeyutils.so.1.5
最后我检查了 rpcbind 需要哪些库,它向我显示了以下内容:
ldd /sbin/rpcbind
linux-vdso.so.1 => (0x00007ffe2b731000)
libtirpc.so.3 => /lib64/libtirpc.so.3 (0x00007f4f06b43000)
libsystemd.so.0 => /lib64/libsystemd.so.0 (0x00007f4f06b1b000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f4f068fe000)
libwrap.so.0 => /lib64/libwrap.so.0 (0x00007f4f066f3000)
libc.so.6 => /lib64/libc.so.6 (0x00007f4f06332000)
libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007f4f060e5000)
libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007f4f05e00000)
libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007f4f05bce000)
libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007f4f059c9000)
libcap.so.2 => /lib64/libcap.so.2 (0x00007f4f057c4000)
libm.so.6 => /lib64/libm.so.6 (0x00007f4f054c2000)
librt.so.1 => /lib64/librt.so.1 (0x00007f4f052b9000)
libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f4f05094000)
liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f4f04e6f000)
libgcrypt.so.11 => /lib64/libgcrypt.so.11 (0x00007f4f04bed000)
libgpg-error.so.0 => /lib64/libgpg-error.so.0 (0x00007f4f049e8000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f4f047ce000)
libdw.so.1 => /lib64/libdw.so.1 (0x00007f4f04586000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f4f04382000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f4f0416c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4f06f8a000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x00007f4f03f52000)
libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007f4f03d43000)
**libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f4f03b3f000)**
libattr.so.1 => /lib64/libattr.so.1 (0x00007f4f03939000)
libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f4f036d8000)
libelf.so.1 => /lib64/libelf.so.1 (0x00007f4f034c1000)
libbz2.so.1 => /lib64/libbz2.so.1 (0x00007f4f032b1000)
libz.so.1 => /lib64/libz.so.1 (0x00007f4f0309b000)
由此我可以看出libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007f4f03b3f000)。我的假设是 libkeyutils.so.1 链接到的较高版本导致了问题,但我不确定如何解决此问题,因为在搜索此库时,它显示了我已经安装的软件包。有任何想法吗?
编辑
我只是想补充一点,Ijaz Khan 的建议解决了我的问题,我在没有 Yum 的情况下安装时遇到了版本问题。