Questions tagged [chroot]

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

67 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
431 views

Bind mounts not visible in chroot

I am using a debootstrap envs on my Arch system. I bind-mount some directories from my home dir into the chroot fs home dir, ie. /home/user/foo → /stretch/home/user/foo. I can see the content from the ...
kralyk's user avatar
  • 261
5 votes
0 answers
700 views

How to create FTP restricted user with vsftpd? (by terminal in Ubuntu)

I have installed ubuntu 12.04 with vsftpd. I need to create FTP users able to access only directories like /var/www/nameDirectory. I thought it was a very basic feature, but seems not I tried to use, ...
Sasha Grievus's user avatar
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
3 votes
1 answer
2k views

How to install arch linux packages with yaourt when invoked with docker build from Dockerfile?

I am trying to build my own jira container using official pritunl/archlinux image. I have already installed yaourt and committed that to rusk85/archbase. My Dockerfile looks like this: 1: FROM rusk85/...
Sven M.'s user avatar
  • 321
3 votes
0 answers
390 views

Why is "ls /.." different to "ls /" in fakechroot fakeroot chroot environment?

I am testing a bash script. It sometimes does this: ls /.. In Linux, this is same as: ls / But in a fakechroot setup like this: fakechroot fakeroot chroot sandpit I get a list of files in my ...
philcolbourn's user avatar
3 votes
1 answer
1k views

SFTP with chroot in a folder that can not have root privileges

I have troubles with setup a SFTP with chroot in "public" folder. Each client on my server has 3 to X accounts. These three accounts are: USER - system account only for internal use, requires full ...
Galmi's user avatar
  • 161
2 votes
1 answer
887 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
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
2 votes
2 answers
2k views

Is it possible to run a process in chroot with virtual /proc filesystem under Linux?

I need to run a process in a chroot with a virtual /proc filesystem, so the process is unable to get access to other processes running on the same host. The process must be run under root and have ...
user4674453's user avatar
2 votes
0 answers
2k views

chroot under Mac OS X

So I have googled a lot with different search terms, but didn't find anything usable, only that intead of ldd I have to use otool -L to see the used libraries of a programm. I tried to copy bash into ...
Ingwie Phoenix's user avatar
2 votes
1 answer
6k views

How do I mount as a read-write filesystem and not read-only?

I'm trying to install Gentoo in a virtual machine. I ran into this problem and began researching what the answer might be. The file system is read only. I can't mount it as read-write. I'd rather ...
mace's user avatar
  • 101
1 vote
2 answers
538 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
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
1 vote
0 answers
360 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
1 vote
0 answers
171 views

How to sandbox code in chroot for multiple users?

What am I trying to do? I'm writing a code evaluator using chroot and python and went to hackerrank for some inspiration. What I think is happening at Hackerrank? Hackerrank creates run-...
shakeel's user avatar
  • 111
1 vote
0 answers
166 views

exiting chroot leads to getpt failure

On a Debian Jessie machine I have a rootfs image which I chroot in this way: mount myimage.img /mnt/myimage cp /usr/bin/qemu-arm-static /mnt/myimage/usr/bin/ mount --rbind /dev /mnt/myimage/dev mount -...
Mark's user avatar
  • 438
1 vote
0 answers
481 views

creating linux device files for bootstrap

I'm currently independently researching device files as a part of learning more about the Linux system in depth. My current goal is to bootstrap Debian Linux through cdebootstrap. I followed the guide ...
cellsheet's user avatar
  • 111
1 vote
0 answers
355 views

setting up mirrorlist for pacman.d in chroot / installing arch to usb stick

I am new to ArchLinux and—moreover—deeper linux noodling. I am following the guide on the Arch Wiki. I am at a step where I set up the mirror list for repositories. I have my mirrorlist file in ...
itascaphasar's user avatar
1 vote
1 answer
3k views

Chroot into Arch Bootable USB

I have a bootable USB drive with Arch Linux recently installed on it (Linux kernel 3.19.2). I want to plug it in to my computer and chroot into it (or possibly run it inside a container, using systemd-...
shardulc's user avatar
  • 153
1 vote
1 answer
897 views

"Cannot open audit interface" upgrading libuuid1 --- is selinux confused?

I have a Debian chroot on a Linux system running an alternative Linux distro. It's always worked fine in the past but in the past few months I've found myself unable to upgrade libuuid1. Instead it ...
David Given's user avatar
1 vote
0 answers
1k views

Set up sftp mysql authentication with chroot

How do I set up an openssh SFTP server that authenticates against a MySQL table where the users are jailed? Each user will need to have its own jail: /home/sftp/john /home/sftp/jane etc.. However ...
Fabian's user avatar
  • 111
1 vote
1 answer
1k views

How to hide subdirectories within chrooted directory from users who don't have access

Apologies if this problem has been answered before / elsewhere. I've had a hunt around but am unable to find anything. If so please point me in the right direction. I'm running a linux ftp server (...
alex's user avatar
  • 11
1 vote
0 answers
1k views

How to get out of a chrooted environment in ArchLinux

I'm attempting to install ArchLinux via SSH. At the moment I'm not at the machine, but I do have root access to it. I have SSH setup in the Chroot environment (arch-chroot). Is there anyway, while ...
monksy's user avatar
  • 1,731
1 vote
0 answers
105 views

Is there a way to use ACL to deny access to folders by user, preferrably by making them invisible?

Is there a way to use Linux's Access Control Lists feature to deny access to folders by user, preferrably by making them invisible? This is needed for a chroot SFTP environment where we want to block ...
kinesis's user avatar
  • 11
1 vote
0 answers
407 views

Unity closes on Ubuntu Logout, but does not complete logout. (Crouton on Chromebook)

I've got a Chromebook 14 "dual-booting" Ubuntu 14.04 using Crouton with the stock Chrome OS. I've had it like this for a while with everything operating fine. As you know, Linux Distros are kind of ...
Benji's user avatar
  • 11
1 vote
0 answers
2k views

Logging rssh/chroot SFTP users

I'm trying to log activity (uploads, downloads, renames, deletes) for SFTP users. If I SFTP with a normal user, it logs to /var/log/secure. If I SFTP with a rssh user, it logs that they connected, but ...
Darren's user avatar
  • 186
1 vote
0 answers
1k views

chroot SFTP user can't modify any files in mounted drive

Well, here are the steps I’ve done; the problem is listed at the bottom. sudo mkdir /home/test sudo useradd test sudo chown root:test /home/test sudo chmod 755 /home/test sudo groupadd testgroup sudo ...
blaize9's user avatar
  • 11
1 vote
0 answers
57 views

statify executables in chroot

I am trying to run arbitrary executables in a chroot. Unfortunately I have different version of the shared library dependencies of some of the executables in the chroot. Is it possible to reroute the ...
Trev0r's user avatar
  • 19
1 vote
0 answers
110 views

tazpkg install option asking for su when in chrooted image

I am trying to install a couple of packages in slitaz chrootd image but tazpkg keeps asking for su privilages. I have fallowed this tutorial http://doc.slitaz.org/en:handbook:chroot Host is Ubuntu ...
mkvcvc's user avatar
  • 111
0 votes
0 answers
17 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 ...
HCSF's user avatar
  • 165
0 votes
0 answers
202 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,843
0 votes
1 answer
70 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
842 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
0 votes
0 answers
113 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
0 votes
0 answers
231 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
251 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
0 votes
1 answer
420 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
  • 11
0 votes
0 answers
688 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
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,803
0 votes
0 answers
64 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
62 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
0 votes
1 answer
511 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
0 votes
1 answer
211 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,103
0 votes
0 answers
67 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
239 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
184 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
0 votes
0 answers
110 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
0 votes
1 answer
134 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
361 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
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