如上图所示,造成这个原因是什么啊
![]() | 1 liuxu 2020-04-10 21:57:26 +08:00 google 一下你就知道了。权限在 inode 里,软连接只是指向了文件的 inode,然后读取 passwd 的 inode 里面的权限数据,你这用户的权限没有 |
![]() | 3 choury 2020-04-10 23:11:01 +08:00 strace cat xxx 看下什么错误不就知道了 |
![]() | 4 cnt2ex 2020-04-11 00:27:51 +08:00 似乎是和目录的 sticky bits 有关。 https://lwn.net/Articles/390565/ The solution is to permit symlinks to only be followed when outside a sticky world-writable directory, or when the uid of the symlink and follower match, or when the directory owner matches the symlink's owner. |
![]() | 5 cnt2ex 2020-04-11 00:32:02 +08:00 ![]() /proc/sys/fs/protected_symlinks 把值改成 0 就可以了。具体可以看 https://www.kernel.org/doc/Documentation/sysctl/fs.txt |
![]() | 6 liuxu 2020-04-11 08:31:34 +08:00 你把 passwd 权限贴出来 |
![]() | 8 vencentge OP 这是修改为 1 的演示  这是修改 0 的演示  |