Answer the question
In order to leave comments, you need to log in
UID from which processes run in chroot environments?
Task: run a service program in a chroot with limited rights (those on behalf of a normal non-root user).
When implementing this function, I tried the chroot, chpst utilities, but both give me an incomprehensible UID from which they work.
# chroot --userspec srv-1465:users /gh_mounts/ghroot /bin/bash
bash: /root/.bashrc: Permission denied
[email protected] / $
[email protected] / $ id
uid=1046(srv-1465) gid=100(users) groups=100(users)
Answer the question
In order to leave comments, you need to log in
Actually, when the application is executed inside the chroot, it tries to read the /root folder that is inaccessible to it
What exactly did you want to ask? Why can't /root be read? Because you made a chroot yourself and restricted the application to the root of your chroot and the corresponding rights.
Solved the problem.
An application running in a chroot environment tries to read files from /root because of the specified variables:
[email protected] / $ id
uid=1046(srv-1465) gid=0(root) groups=100(users)
[email protected] / $ env | grep root
USER=root
MAIL=/var/mail/root
HOME=/root
LOGNAME=root
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question