Does chroot () require root privileges?

Everything in question. When I try to use chroot with "." or the full path as an argument, perror tells me "Operation not allowed." If the answer to my question is yes, is there any other way to change the root directory? (Without barbaric methods using strcmp () / strncmp ())

Thank!

+7
source share
4 answers

chrootcan only be used by roothim / her /. And no, there will be no other way without compromising security.

From Wikipedia

root chroot. , setuid chroot (, /etc/passwd /etc/shadow ), .

. .

+6

PRoot ptrace syscall, - chroot.

+3

fakechroot chroot

+3

schroot. /etc/schroot/schroot.conf

[xenial]
description=Ubuntu 16.04 (xenial)
type=directory
directory=/srv/chroots/xenial
aliases=xenial-lts
profile=minimal
users=bob
personality=linux64

:

schroot -c xenial
0

All Articles