Sample Header Ad - 728x90

Why are some symlinks unreadable when their target is readable?

0 votes
2 answers
87 views
On Linux, I'm looking at /proc/1/cwd. This symlink is not readable as a normal user:
$ ls /proc/1/cwd
ls: cannot access '/proc/1/cwd': Permission denied
But /proc/1 is accessible:
$ ls /proc/1
After becoming root, you see that /proc/1/cwd points to / (filesystem root):
$ sudo ls -l /proc/1/cwd
lrwxrwxrwx 1 root root 0 Feb 21 12:56 /proc/1/cwd -> /
And of course the filesystem root is readable, as a normal user:
$ ls /
If symbolic links don't have any permissions on Linux, then why is such a symbolic link not readable, when its target (the filesystem root) is readable?
Asked by codeandfire (215 rep)
Feb 21, 2025, 08:16 AM
Last activity: Feb 21, 2025, 09:23 AM