Tôi có 2 người dùng trong máy của mình: linuxlitevà otheruser.
otheruser có một tập tin:
otheruser@linuxlite:~$ ls -l a
-rw-rw-r-- 1 otheruser otheruser 6 Mar 31 12:47 a
otheruser@linuxlite:~$ cat a
hello
linuxlitetạo một tệp và một liên kết tượng trưng trong /tmp:
otheruser@linuxlite:~$ ls -l /tmp/file /tmp/link
-rw-rw-r-- 1 linuxlite linuxlite 3 Mar 31 12:49 /tmp/file
lrwxrwxrwx 1 linuxlite linuxlite 17 Mar 31 12:49 /tmp/link -> /home/otheruser/a
Bây giờ, mặc dù otherusercó thể đọc /tmp/filevà /home/otheruser/a, anh ta không thể đọc /tmp/link:
otheruser@linuxlite:~$ cat /tmp/file
hi
otheruser@linuxlite:~$ cat /home/otheruser/a
hello
otheruser@linuxlite:~$ cat /tmp/link
cat: /tmp/link: Permission denied
Câu hỏi của tôi là, tại sao không thể otheruserđọc một symlink thuộc sở hữu linuxlitenếu anh ta có thể đọc mục tiêu và một tệp khác do anh ta sở hữu trong cùng thư mục với symlink?
Nếu nó quan trọng, thì các quyền trên /tmplà:
otheruser@linuxlite:~$ ls -l -d /tmp
drwxrwxrwt 9 root root 4096 Mar 31 13:17 /tmp
Phân phối là Linux Lite 3.0, kernel là: Linux 4.4.0-21.generic (i686)