Questions tagged [chroot]
chroot is a command on UNIX-like systems which runs a process under a different root directory.
184
questions
0
votes
0
answers
48
views
How to fix the issues after giving the command chroot?
Previously I got issues with both the lightdm and gdm3. Due to that I am still stuck in the gnome login screen and then to TTY. I am using a Kali linux 2024.2 ARM 32-bit OS.
After a rebooting the ...
1
vote
1
answer
48
views
Arch stuck at grub shell
After rebooting my laptop I am stuck at grub shell. Not sure what steps to recover.
I was going to arch-chroot my install from a live usb, but can't seem to do that with my setup:
Arch
BTRFS encrypted ...
0
votes
0
answers
58
views
How to run gnome wayland inside schroot?
I would like to run Gnome using wayland inside a schroot. So far my experiements have been unsuccessful. Here is how I have set-up the schroot:
debootstrap --variant=minbase --include=sudo bookworm /...
1
vote
0
answers
42
views
How to change root without side effects
How can I, preferably without entering a new subshell, change root for the current shell, while keeping the same environment ? The assumption would be that the new root and sub-directories from that ...
0
votes
0
answers
78
views
Unable to get to switch_root mode in CentOS 7
I am trying to reset the root password on my old drive, and I followed this instruction:
https://www.redhat.com/sysadmin/recover-root-passwd
However, instead of booting into a 'rescue' prompt as the ...
0
votes
0
answers
546
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 ...
0
votes
1
answer
186
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 /...
0
votes
1
answer
99
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 ...
0
votes
0
answers
1k
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 ...
1
vote
2
answers
693
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 ...
1
vote
1
answer
756
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. ...
0
votes
0
answers
156
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 ?
1
vote
1
answer
15k
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
...
1
vote
1
answer
2k
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 ...
0
votes
0
answers
270
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@...]# ...
0
votes
0
answers
277
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 ...
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: ...
0
votes
1
answer
472
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 ...
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 ...
0
votes
2
answers
4k
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 &...
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, ...
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, ...
2
votes
1
answer
1k
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/...
0
votes
1
answer
4k
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 ...
0
votes
0
answers
773
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 ...
2
votes
1
answer
13k
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 ...
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 ...
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 ...
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
...
0
votes
0
answers
70
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 ...
0
votes
0
answers
70
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&...
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 ...
0
votes
1
answer
579
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. ...
3
votes
1
answer
921
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.
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 ...
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 ...
0
votes
1
answer
218
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 ...
0
votes
0
answers
81
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 ...
0
votes
0
answers
269
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.
0
votes
0
answers
188
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 ...
3
votes
1
answer
11k
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 ...
0
votes
1
answer
101
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 ...
1
vote
2
answers
1k
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 ...
1
vote
1
answer
701
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 ...
0
votes
1
answer
604
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 ...
0
votes
0
answers
138
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 ...
1
vote
0
answers
446
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 ...
0
votes
1
answer
142
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 ...
0
votes
1
answer
548
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 ...
1
vote
1
answer
59
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 ...