# Unable to load shared library in DISA STIG hardened Rocky Linux 9.5 Installation

**URL:** <https://forums.rockylinux.org/t/unable-to-load-shared-library-in-disa-stig-hardened-rocky-linux-9-5-installation/18478>\
**Category:** Rocky Linux Help & Support\
**Tags:** rocky-linux-9\
**Created:** [May 15, 2025, 11:12pm UTC](https://forums.rockylinux.org/t/unable-to-load-shared-library-in-disa-stig-hardened-rocky-linux-9-5-installation/18478 "2025-05-15T23:12:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![byosh](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@byosh](https://forums.rockylinux.org/u/byosh)\
**Post date:** [May 15, 2025, 11:12pm UTC](https://forums.rockylinux.org/t/unable-to-load-shared-library-in-disa-stig-hardened-rocky-linux-9-5-installation/18478/1 "2025-05-15T23:12:05Z")

</div>

Hello, I hope someone can shed some light on the issue I am having. Using VirtualBox, I set up a VM using Rocky Linux 9.5 with the DISA STIG policy enabled.

I wanted a newer Python version, so I grabbed the latest tarball, and installed the developer tools as well as all recommended dependencies. Configure worked fine, but at some point after the executable and its shared library was complete, it failed when trying to run the interpreter itself as an integrity test.

Since I saw the binary and shared library, I tried to execute it with  
LD\_LIBRARY\_PATH=. ./python  
and was surprised that it was unable to find libpython3.13.so.1.0 which was right there.

Since I wanted to get the build complete, I then fired up another VM without the STIG enabled, and built the binaries and shared libraries, then transferred them to the STIGged machine.

Again, something in the system makes the attempt to load the shared library to fail with a “No such file” error when executing python.

Is there a remedy which allows me to keep the STIG hardening yet allow me to run the binary. When installing, I did properly create the file in /etc/ld.so.conf.d and ldconfig, and ldd properly showed the dependent lib, but the executable does not run.

(edited)  
The error message given differs between root and a normal user. Note that I have installed in /opt/python313, and have added to my path, and updated the library resolution with ldconfig.

Error as root: error while loading shared libraries: libpython3.13.so.1.0: cannot open shared object file: No such file or directory  
(Error as user: bash: /opt/python313/bin/python3.13: Operation not permitted  
(end edit)

Thank you very much in advance,  
Ben.

---

<div class="post-metadata">

**Author:** ![byosh](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@byosh](https://forums.rockylinux.org/u/byosh)\
**Post date:** [May 17, 2025, 12:55am UTC](https://forums.rockylinux.org/t/unable-to-load-shared-library-in-disa-stig-hardened-rocky-linux-9-5-installation/18478/2 "2025-05-17T00:55:19Z")

</div>

This is just for anyone who wanted the solution. Apparently, the hardening also enabled fapolicyd, preventing untrusted executables and shared libraries from being loaded. The brute-force would be to disable/uninstall fapolicyd, and the correct solution would be to add a rule to make an exception for the installation directory. Another alternative would be to add the contents of the entire directory to the trusted file database. For further reference, see the man page for fapolicyd-cli.

---

<div class="post-metadata">

**Author:** ![byosh](https://avatars.discourse-cdn.com/v4/letter/b/ecccb3/32.png) [@byosh](https://forums.rockylinux.org/u/byosh)\
**Post date:** [May 17, 2025, 9:28pm UTC](https://forums.rockylinux.org/t/unable-to-load-shared-library-in-disa-stig-hardened-rocky-linux-9-5-installation/18478/3 "2025-05-17T21:28:24Z")

</div>

(Tapped on something and deleted my post with no way to undo it. Reposting)

This is just for anyone who wanted the solution. Apparently, the hardening also enabled fapolicyd, preventing untrusted executables and shared libraries from being loaded. The brute-force would be to disable/uninstall fapolicyd, and the correct solution would be to add a rule to make an exception for the installation directory. Another alternative would be to add the contents of the entire directory to the trusted file database. For further reference, see the man page for fapolicyd-cli.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [July 16, 2025, 9:29pm UTC](https://forums.rockylinux.org/t/unable-to-load-shared-library-in-disa-stig-hardened-rocky-linux-9-5-installation/18478/4 "2025-07-16T21:29:36Z")

</div>

Closed on July 16, 2025, 9:29pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
