gpt4 book ai didi

c - chroot() 需要 root 权限吗?

转载 作者:IT王子 更新时间:2023-10-29 00:25:10 25 4
gpt4 key购买 nike

当我尝试将 chroot 与“.”一起使用时或作为参数的完整路径名,perror 告诉我“不允许操作”。

如果我的问题的答案是肯定的,是否有另一种更改根目录的方法? (没有使用 strcmp()/strncmp() 的野蛮方法)

最佳答案

chroot 只能由 root 他/她/自己使用。不,在不损害安全性的情况下不会有任何其他方式。

来自维基百科

Only the root user can perform a chroot. This is intended to prevent users from putting a setuid program inside a specially crafted chroot jail (for example, with a fake /etc/passwd and /etc/shadow file) that would fool it into a privilege escalation.

参见 here对于文章。

关于c - chroot() 需要 root 权限吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15985290/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com