小编use*_*822的帖子

/tmp 中符号链接的权限

我的机器上有 2 个用户:linuxliteotheruser.

otheruser 有一个文件:

otheruser@linuxlite:~$ ls -l a
-rw-rw-r-- 1 otheruser otheruser 6 Mar 31 12:47 a
otheruser@linuxlite:~$ cat a
hello
Run Code Online (Sandbox Code Playgroud)

linuxlite制作了一个文件和一个符号链接/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
Run Code Online (Sandbox Code Playgroud)

现在,虽然otheruser可以阅读/tmp/file/home/otheruser/a,但他无法阅读/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
Run Code Online (Sandbox Code Playgroud)

我的问题是, …

permissions symlink tmp permission-denied

8
推荐指数
1
解决办法
592
查看次数

标签 统计

permission-denied ×1

permissions ×1

symlink ×1

tmp ×1