Linux (CentOS): access denied in /proc, disabling fs.protected_symlinks
Temporarily disable the kernel symlink protection with sysctl.
On CentOS, an access-denied error in /proc/ (for example when following a symlink in a sticky-bit directory) can come from the symlink protection of the kernel. The note disables it like this:
sudo sysctl -w fs.protected_symlinks=0
fs.protected_symlinks=1prevents following a symlink located in a world-writable sticky directory unless the link owner matches the directory owner or the follower.sysctl -wonly lasts until reboot. To make it permanent, addfs.protected_symlinks = 0to a file under/etc/sysctl.d/.
Notes
This protection improves security: only disable it once the cause is clearly identified, and set it back to 1 afterwards if possible.