Questions tagged [chroot]

chroot is a command on UNIX-like systems which runs a process under a different root directory.

Filter by
Sorted by
Tagged with
0 votes
0 answers
130 views

How to properly unmount a bind mount?

In order to create a chroot, I often do something like: mount --bind /dev ./dev But when I try to unmount ./dev, it sometimes attempts to unmount/redirect to /dev instead. How to tell I want to ...
user2284570's user avatar
  • 1,825
0 votes
1 answer
63 views

stat not working correctly in proot environment

I'm trying to use proot under Ubuntu 22.04 to create an isolated environment with a separate home directory. I'm running the following: proot -r /home/user/testroot/ -w /home/user -b /bin:/bin! -b /...
andy28's user avatar
  • 35
0 votes
1 answer
59 views

Cant start xinit from chroot

I have been trying to run a graphical system from a debian bootstrap What i did is create a basic bootstrap using debootstrap, Installed openbox as a test wm, Set Display variable according to Arch ...
Riyadh Kabir's user avatar
0 votes
0 answers
805 views

Kali linux Kernel panic - not syncing: Attempted to kill init! exitcode=0x00007f00

I was running fsck for a disk in initramfs and after it finished, I wrote “exit” in terminal. After that, when booting in that drive, I still have the kernel panic screen. Tried to chroot into broken ...
Evil Six's user avatar
1 vote
2 answers
518 views

LFS 11.2 on Ubuntu Server 22.04: chroot: failed to run command ‘/usr/bin/env’: No such file or directory

I have been following the LFS 11.2 guide and it has gone smoothly up until the chroot part. Although the symlinks have created properly i.e. relative to the LFS directory, the error is still ...
Abhinav Gupta's user avatar
1 vote
1 answer
522 views

how to chroot a python app?

I created a simple app in python flask, I would like to put it in a chroot. a very thin jail only containing the bare minimum for this app to run. This is for a school project so I need to use chroot. ...
lolozen's user avatar
  • 137
0 votes
0 answers
102 views

How to chroot nginx virtual hosts

I want to prevent php scripts inside virtual hosts from accessing files outside their document root. How is this possible without using containerization ?
Tinsae's user avatar
  • 111
1 vote
1 answer
8k views

How to create SFTP user with specified directory permissions

I have done the following tutorial: How to Create SFTP User with Specified Directory Permissions in Ubuntu 20.04. Creating new Sftp User: # useradd -m -d /home/example.com sftp_user # passwd sftp_user ...
ncaffrey's user avatar
1 vote
1 answer
1k views

How to mount overlay filesystem over root folder in linux?

I want to mount an overlay filesystem over the root folder. My commands are: mkdir -p merged upper work sudo mount -t overlay ovr -o index=off -o lowerdir=\,upperdir=upper,workdir=work merged I get ...
nadapez's user avatar
  • 232
0 votes
0 answers
219 views

SFTP prevent user from deleting original directory

I cannot find how to prevent chroot users from deleting some original directory. I have an SFTP that is already working. Below is my process to create a directory for new partners. [root@...]# ...
Sophal Sun's user avatar
0 votes
0 answers
243 views

How to avoid chroot jail affect actual system (e.g. update system time)?

I am new to chroot. I thought chroot is a contained separated system that would avoid things happen inside chroot jail affecting the actual system outside the jail. However I just confirmed that if I ...
midnite's user avatar
  • 571
2 votes
1 answer
2k views

How to chroot into a WSL installation form another WSL installation?

I want to chroot into my Kali Linux WSL from my Ubuntu WSL. I'm running WSL2. In Windows, I mapped my Kali Linux WSL installation (\\wsl$\kali-linux) to the drive K:. In Ubuntu WSL, I mounted the K: ...
Adel M.'s user avatar
  • 143
0 votes
1 answer
408 views

warning: no inet socket available: No such file or directory

so there i am using chroot to chrooting into debian bootstrap everything worked just right on root account until i added a new user to figure out that i cannot do update or access xdisplay or ...
amera's user avatar
  • 1
1 vote
3 answers
2k views

LFS chroot cannot find /usr/bin/env

I am building Linux from Scratch (guide version 10.1). Everything compiled without any errors, but I am now stuck at the step where it requires me to enter the chroot environment (section 7.4). My ...
lorinet3's user avatar
  • 125
0 votes
2 answers
3k views

How to hide other user's home directories on Linux

I run several systems with hundreds of home directories (a custom web hosting setup, where third parties can have control of certain accounts). Currently any user could SSH in (or via a script) do &...
Nick's user avatar
  • 103
3 votes
1 answer
1k views

Chroot, Containers or Virtualization on OS X for safe development

I would like to provide a bit of context before asking my questions: I've been working on Windows/Linux for years, and recently I was having a good time with WSL2. My Windows machine isn't powerful, ...
jacksonbenete's user avatar
2 votes
1 answer
1k views

What is meant by "don't run processes as root in a chroot environmentl"

I read several articles that say one should avoid running processes as root in a chroot environment since it allows the process to escape. But how should I do that? Chroot can only be evoked by root, ...
M0M0's user avatar
  • 131
2 votes
1 answer
844 views

Cannot detach file-backed loop device after unmounting

I have some image files that I often use for cross-compilation work via chroot. My usual deal is to create a loop device with it, mount its main partition, bind mount /dev, /proc, /sys, and maybe /etc/...
Mona the Monad's user avatar
0 votes
1 answer
3k views

How to mount /run from a Linux live usb in order to chroot?

I have a system dual booted with Windows 10 and Linux on it for some reason I'm getting "You need to load the kernel first" error on the grub menu so someone has advised me to boot from a ...
ansme's user avatar
  • 113
0 votes
0 answers
672 views

How to set up apparmor for Bind DNS?

I have figured that on my server apparmor was preventing me from running Bind in chrooted environment. I have created folder /chroot/named with all of the directories and files that Bind requires in ...
beepbeep's user avatar
  • 101
1 vote
1 answer
10k views

Connect with a user in SFTP and SSH

I want to allow a non-root user to log in SFTP with Filezilla (for modify files), in the /home/test folder AND to connect in SSH (for other operations). I work on a Debian 10.7. Root is the owner of ...
Noxitot's user avatar
  • 13
0 votes
2 answers
1k views

how to change UUIDs on a boot stick, and update GRUB?

I've got a working Legacy/UEFI boot stick with Xubuntu focal. All is well with it. Now I'm creating clones, and for that purpose, I've changed stuff on each: hostname UUIDs of partitions UUIDs ...
4dummies's user avatar
  • 133
0 votes
1 answer
1k views

Is fakechroot a security flaw? [closed]

I recently know more about fakechroot. AFAIK it seems dangerous since it escalates user privilege, even if it's in chroot. I'm aware of fakeroot but it is not the same since you can't do anything with ...
Quoc-Hao Tran's user avatar
0 votes
1 answer
3k views

Howto properly mount /proc, /run to prevent chroot from being able to see or kill processes belonging to the host

I use a loop in a script to mount --bind special filesystems such as /dev, /dev/pts, /proc, /run, /sys (and /sys/firmware/efi/efivars optionally) this way : for specialFS in dev dev/pts proc run sys ...
SebMa's user avatar
  • 1,773
0 votes
0 answers
61 views

OpennSSH for windows: %u gives <domainname>/<username>

I'm using OpenSSH 8.1 for Windows and I'm trying to chroot users to their AD home dir [D:\homes\sub\<username>] using %h in the config file, however the chroot-directory redirects the user to ...
Ma Sch's user avatar
  • 101
0 votes
0 answers
61 views

Trouble setting up permissions for jailed SFTP user

I'm running Arch and have created a new user named moderator that I would like to give access to a couple of folders that they can read / write to. My plan was to create a new folder, named "mod&...
Syllith's user avatar
  • 101
2 votes
0 answers
2k views

sshd "received disconnect: disconnected by user"

I can successfully login to the SFTP server (uses SFTP chrooting), but every time I issue ls, the connection will close: I mounted /logs/xxx to /sftp/user/xxx and am unsure if the binding I did has ...
jan04's user avatar
  • 21
0 votes
1 answer
499 views

How can an SELinux filesystem be relabeled in an unpacked squashfs filesystem?

I am trying to configure selinux for a live boot Debian system. SELinux is inoperable due to copious changes during build and system configuration and requires the entire filesystem to be relabeled. ...
Kebam's user avatar
  • 79
3 votes
1 answer
896 views

grub-install hangs when rescuing a linux install via chroot

When attempting to repair a linux bootloader, grub can run into a problem. Running update-grub leaves the program hanging and never completes sucessfully.
Peter Brooks's user avatar
0 votes
1 answer
3k views

Fake /proc/cpuinfo when using chroot

I am trying to install some software using chroot for a Rpi image (pi-gen). Pi-Gen uses chroot to install them. Unfortunately when executing cat /proc/cpuinfo under chroot environment, i get the ...
C. Hediger's user avatar
1 vote
1 answer
1k views

Pulling an Docker Image within a chroot environment

I am trying to create my own, custom Raspberry Pi image using Pi-Gen https://github.com/RPi-Distro/pi-gen Basically I was able to fulfill most of my requirements, but I got a problem while trying to ...
C. Hediger's user avatar
0 votes
1 answer
210 views

Does chroot make effect on bootable usb-pendrive?

Let's suppose I put my Linux usb-pendrive inside my PC. I start the system and the I use chroot to apply same changes to the system. What happen if I reboot the usb-pendrive? Are the changes I made ...
user840718's user avatar
  • 1,073
0 votes
0 answers
65 views

sftp and chroot on debian

I am experimenting with a server running Debian. It should replace my aging Apple server (and since the new Apple server is not a server anymore that is no longer an option). So far everything goes ...
ArjenA's user avatar
  • 1
0 votes
0 answers
236 views

VLC automatically opens when I plug in headphones

I'm on Ubuntu 16.04. VLC media player version 2.2.2 Weathermax. Every time I plug in my headphones, VLC media player opens. I'm wondering if I can disable this from happening.
pairwiseseq's user avatar
0 votes
0 answers
183 views

Gaining real su permission on gnu root debian instead of proot env?

Im running a samsung galaxy j110H, kitkat 4.4.4, rooted. Is it possible to attain real super user privillige on gnuroot debian instead of fakerootfs. Is there any way as in when I type in su; there ...
atheros's user avatar
  • 101
3 votes
1 answer
10k views

nano command not found after entering chroot during arch install

I am new to Linux and running into a problem while trying to install Arch Linux on bare metal with UEFI. I have been following the installation guide on the Arch wiki and, like the title says, after ...
sequinors's user avatar
0 votes
1 answer
83 views

Mistakenly added user 'ubuntu' to a chroot group and cant login to server anymore

Ok, So I have an ubuntu server setup with SFTP chroot. So, any user added to the group 'sftpusers' will be only able to use sftp commands on the server, today while testing rsync, i didnt think and ...
LutherSmi's user avatar
1 vote
2 answers
942 views

AIX 6.1 SFTP: Allow chroot'd user to access files in location outside their home

Long-winded first posting, I have tried to be succint while providing details. I am working on an AIX 6.1 server where SFTP (via WinSCP) is already used by several service accounts to access files in ...
Nick Clifton's user avatar
1 vote
1 answer
647 views

Can't start Apache in chroot with systemctl but can run it manually on my own from Bash with no issue

How to keep my Apache webserver running (prevent from being killed off for some unknown reason) in chroot when launched with systemctl at boot? My setup requires multiple scripts and when I start the ...
Growtopia Jaw's user avatar
0 votes
1 answer
557 views

chroot /bin/bash not found. How to fix without mounting /lib?

I want to chroot into an environment but it doesn't work since it says /bin/bash is not found. I don't know why, the host is running the same Linux image and arch. I made it working by mounting /lib ...
psisis's user avatar
  • 19
0 votes
0 answers
108 views

Cannot detect filesystem for / in chroot

I have a script that requires knowing the file system type by using df /. I'm running this script in a chroot centos7 environment running in a opensuse host, and it is failing because the file ...
pablochacin's user avatar
1 vote
0 answers
351 views

Docker images that don't contain a package manager

I typically think of docker containers as executable processes that get to carry with them little bits of "environment", such that nothing needs to be installed on the docker host. For instance, a ...
fractalic's user avatar
  • 111
0 votes
1 answer
132 views

PuTTy command script hangs after "chroot . sh"

I'm trying to automate a build with Putty, just ssh'ing into a VM and running a few commands by specifying a .txt file that contains the commands to run. One of my commands is chroot . sh and it ...
Bleb's user avatar
  • 1
0 votes
1 answer
508 views

chroot erase and overwrite the rootfs. Is it possible to mount a copy of /proc and /sys?

In my chroot I need /proc and /sys and /dev. I am happy to bind-mount /dev since it is a temp fs. But /proc and /sys are part of the rootfs. In my chroot I need to erase/re-format the rootfs (which ...
code_fodder's user avatar
  • 1,531
1 vote
1 answer
56 views

virtualbox snapshot - is it a safe back-up if I want to over-write (dd to) sda1?

I want to do some testing useing chroot to overwrite sda1 (my main partition) in a ubuntu VM. Is taking a virtualbox snapshot a safe way to create a backup? i.e. in the VM I want to create a chroot ...
code_fodder's user avatar
  • 1,531
0 votes
1 answer
318 views

readelf fails in qemu chroot when using absolute path

I'm trying to install java 8 SDK in a qemu emulated chrooted environment and I'm running up against the following error readelf: Error: /proc/self/exe: Failed to read file's magic number Readelf ...
Fish11's user avatar
  • 113
0 votes
1 answer
349 views

Is there a simple low-overhead way to install deb packages in a virtual environment?

When I'm working on some arbitrary project I usually need a couple of packages. For all the python packages I create a virtualenv so that once I'm done I can delete the whole thing, and it does not ...
Pepijn's user avatar
  • 555
1 vote
1 answer
6k views

Why do I have to specify DNS when using chroot?

Last time when I chrooted from Live USB to my old broken system, I couldn't connect to Internet. In this tutorial, I read I should add OpenDNS to my /etc/resolv.conf if I use DHCP. How does DHCP (or ...
Qback's user avatar
  • 128
8 votes
1 answer
9k views

Fixing '/dev/null: Permission denied' repeatedly in chroot

I've chrooted into an external disk with sudo chroot /mnt/disk, but almost everything I do (logging in, tab-completion, lessing a file, ...) results in an error mentioning /dev/null: Permission denied,...
ash's user avatar
  • 291
0 votes
0 answers
2k views

Creating multiple SFTP users who use different SSH keys to connect to the same chrooted directory?

I have an Ubuntu-powered server, which - among other things - acts as file storage/hosting (powered by nginx), so that if a file is put in /var/www/files.ourcompany.com/file.txt, it is publicly ...
Mads Peter Rommedahl's user avatar