A chroot on Unix operating systems is an operation that changes the apparent root directory for the current running process and its children. A program that is run in such a modified environment cannot name (and therefore normally not access) files outside the designated directory tree.

learn more… | top users | synonyms

10
votes
4answers
45k views

How to create a FTP user with specific /dir/ access only on a Centos / linux installation

So I'm on a VPS - CentOS Linux installation. I have vsFTPd on the server. I currently have SFTP access to the server via my root user, but am now trying to create a new user with FTP access to a ...
3
votes
1answer
284 views

Backing up chroots for host reinstall

I've had my workstation for a couple of years now and its slowly become a complex beast, taking on many roles for my dev and test work. I have done some research and was thinking of setting up some ...
1
vote
1answer
345 views

How do I run chromium inside a chroot?

Okay, I can run Iceweasel 17 ESR fine and some simple X apps like xkill, so I know that it's not merely an X display problem. However any version of Chromium and Iceweasel 24 fail with the following ...
1
vote
1answer
56 views

Chroot gone wrong, can't ssh with user

Distribution: Scientific Linux 6.5 (Carbon), not exactly your typical brand of linux. Tried to chroot a user using these instructions for SSH and quite obviously failed, and now I can't even log in ...
1
vote
1answer
44 views

Disable operations outside user's home directory with chroot jail?

I'm trying to restrict a user to a specific directory called gclegal using a chroot jail. I've uncommented the line in the /etc/vsftpd.conf file chroot_local_user=YES Created a new user called kg: ...
4
votes
1answer
393 views

Simulate chroot with unshare

I am trying to write a bootstrapper for a minimal, from-source linux distribution. I would like to build in a chroot-like environment. This should simplify packaging. I do not care about security at ...
4
votes
2answers
4k views

How to unmount a formerly chroot'd filesystem?

I'm using a rescue-live-system (similar to a live-cd) to fix some issues with my Debian server, like that: # mkdir -p /mnt/rescue # mount /dev/md2 /mnt/rescue # mount --bind /dev /mnt/rescue/dev/ # ...
4
votes
2answers
42 views

How to prevent schroot from overridding passwd file and others files already present on the chrooted system?

When I had to repair my Debian system, I tried to use schroot due the convenience of not having to mount bind several partitions. But, contrary to my expectations, schroot decided to override my ...
3
votes
1answer
47 views

Error message: unknown user 'geoclue' in statoverride file

I obtained a strange error message inside a chroot: unknown user 'geoclue' in statoverride file when running apt-get install or apt-get upgrade. I use schroot to enter this chroot. I found that I ...
2
votes
1answer
413 views

CHROOT: Unable to copy files to jailed users directory from local machine using WINSCP

I've setup a chroot environment for one of my users called client on my system. I'm using WINSCP to connect to my server from my machine using public key authentication. Everything works fine, I can ...
1
vote
1answer
22 views

Define custom login shell in schroot

According to the schroot man page: schroot allows the user to run a command or a login shell in a chroot environment. If no command is specified, a login shell will be started in the user's ...
1
vote
1answer
30 views

Can't losetup anything on armhf NAS

I'm pretty new to linux and chrooted my NAS with armhf architecture and tried looping device: losetup -f losetup: Could not find any loop device. Maybe this kernel does not know about the loop ...
0
votes
0answers
24 views

How do I get back into crouton on a Chromebook?

I installed crouton with the Unity interface like in this tutorial. I tried to install Gimp with the terminal after two months of use and it froze so I quit the terminal and went out of ...
1
vote
1answer
685 views

Any better alternative to chroot on an OpenVZ VPS?

Are there any better alternative to chroot environment? I'm thinking about running nginx on a jailed environment. BTW, I'm on OpenVZ VPS, so modifying the Kernel is a no-no. (I think that prevents ...
1
vote
1answer
29 views

Using bash environment from an external OS partition

I have an external partition, /dev/sda, which contains an Ubuntu OS. The root is located in /dev/sda2. I would like to access commands from this OS partition. I have tried doing the following ...
3
votes
1answer
60 views

Real chroot on a systemd machine

I'm trying to get used to systemd, because it seems to be the way that Debian is going. I want to run Xorg in a chroot on hardware, rather than using networking (which seems to be the canonical way ...
1
vote
1answer
757 views

Apache + mod_fcgid + chroot with mod_security. CentOS/RHEL 6

I am trying to setup a web server running Apache + mod_fcgid + mod_security chroot enabled and having a real hard time to get this working. Apache was installed from official CentOS repo and mod_fcgid ...
3
votes
1answer
497 views

suexec with chrooted environment

I'm trying to get a chrooted Apache environment working running mod_fcgid with suexec. Looking at suexec log inside jail, the wrapper scripts are being executed with no problems, however, when I look ...
4
votes
1answer
63 views

Automate chroot into broken system

Every time you have to mount a system with a live-boot-CD and chroot into the system to repair grub, you have to type so many lines to mount into the right partition: fdisk -l find the right ...
2
votes
0answers
35 views

How to use chroot'd desktop environment on Android with external display, mouse and keyboard?

I have a chroot'd Arch Linux environment set up on my Android phone (a OnePlus One) and I would like to connect it to a monitor (directly or with use of some sort of passthrough/adapter eg. Raspberry ...
1
vote
1answer
81 views

chroot for sftp user

I followed multiple guides on the internet on how to restrict a user so that he cannot change/see files outside of his home directory. So I created a user, let's call him john and I also created a ...
1
vote
1answer
1k views

How can I chroot into a live filesystem.squashfs Linux distribution?

I would like to chroot into a Live USB Linux distro, if such thing is possible. I don't know if there is a generic method, so I will detail my specific test. I am testing Kali Linux v1.0.5 Live USB ...
1
vote
1answer
44 views

Deterministic method to find out whether some other process is in a chroot jail and where?

NOTE: I'm familiar with this U&L Q&A titled: How do I tell I'm running in a chroot? that sounds similar to what I'm asking, but there's a subtle difference to what I'm looking for. That ...
2
votes
2answers
65 views

How to use/test pivot_root?

I want to test the pivot_root command which moves the root file system of the current process to the directory put_old and makes new_root the new root file system. But I always get the following ...
9
votes
1answer
4k views

How can I access a directory outside a chroot from within it?

I have a user which is chrooted to her home directory, but I want her to also be able to manage files within /var/www. As such, I did the following: root@server:/home/username# ln -s /var/www www ...
0
votes
1answer
22 views

How can I convert a chroot into a GRUB2 bootable ISO image?

Say I have a chroot containing what will be a working Linux system, and some additional init scripts to mount an overlay filesystem (e.g. AUFS) over it. I've also generated a GRUB2 boot menu. What ...
0
votes
0answers
20 views

Where to create virtual link for chroot?

I've tried to pass this step of lfs but when i put: chroot "$LFS" /tools/bin/env -i I got: chroot: failed to run command '/tools/bin/env': No such file or directory So i search about it and ...
3
votes
1answer
49 views

chroot into a sshfs folder

I am trying to chroot into a sshfs-mounted directory: mkdir remoteroot sshfs remote:/ remoteroot/ sudo chroot remoteroot/ but I get chroot: cannot change root directory to remoteroot/: Permission ...
0
votes
0answers
36 views

Are system calls available in a chroot environment?

I'm experiencing a lot of compilation errors regarding missing system calls (e.g. error: '__NR_name_to_handle_at' undeclared (first use in this function)) with different projects (ganesha 2.1.0 ...
4
votes
2answers
60 views

Could you explain this “chroot” /tmp directory creation?

In the following linked article they explain how to create a "chroot" /tmp directory. I'm a bit confused by what they did. Could someone explain what the following commands are doing? Noexec and /tmp ...
1
vote
1answer
47 views

Limit access on external drive mounted and used by sftp

I've got a unix user "popolo" who is chrooted in /srv/ftp/ and I mount my two external drives by /etc/fstab in /srv/ftp so I have /srv/stp/dude and /srv/ftp/sweet. Popolo has access to those drives ...
2
votes
1answer
40 views

How does chroot's use of qemu for cross compile environments work?

To be able to do cross compiling there's a trick where you copy a static qemu binary into your <different-arch-root-to-be>/usr/bin and when you chroot into that filesystem, which has non-native ...
0
votes
0answers
40 views

How to setup a scanner in crouton chroot?

I have ubuntu 12.04 installed on my hp chromebook using crouton but I'm not sure how to access a usb device from inside the chroot. I'm trying to access a brother DS-720D scanner with xsane. From ...
3
votes
2answers
65 views

How can I force chrooted programs to use a virtual ethernet device?

First off, this is not for security reasons, or for use in a production environment. It's because I want to mess around with different configuration management systems on relatively low-spec ...
3
votes
1answer
9k views

How to restrict ssh users to browse only /home/%u contents

Can I confine my users to their /home/%u directory using only OpenSSH configuration? From instructions I found on the Internet, I stopped the SSH server and appended the following to the sshd_config ...
2
votes
1answer
90 views

Why does chroot get ENOENT on an existing file?

;TL-DR - Answer: because the dynamic linker ld-linux-x86-64.so.2 was missing. I have mounted a squashfs (shouldn't matter) filesystem -ro,loop at /mnt/foo. It contains among other things the ...
0
votes
1answer
5k views

Chroot in to reinstall Grub2 reinstall, mnt/ is empty

I have a common problem: I installed Fedora 18 on my PC that has Windows on it. When I start the PC I don't get asked which system I want to boot, Windows is chosen always. So I found out that I ...
0
votes
1answer
44 views

ARM cross compilation package not found

I'm trying for arm cross compilation on my i386 machine using sysroot and chroot.I want to set environment variables like PKG_CONFIG_PATH to sysroot.Right now my code is not compiling because it is ...
2
votes
1answer
168 views

How to build gcc inside a Debian chroot?

I used debootstrap to set up a minimal Debian system (x86): debootstrap wheezy /var/chroot http://ftp.debian.org/debian/ Then I entered the chroot and installed some packages: apt-get install ...
3
votes
2answers
98 views

chroot jail that can access the filesystem

chroot jails seem to be simply a different world, with no interaction with the actual filesystem. Thus, the entire environment has to be replicated inside the chroot, which would mean making a full ...
2
votes
0answers
327 views

How do I run Gnome from a systemd-nspawn container in a second X server?

I'm using systemd-nspawn to "boot" a second Linux OS from a USB hard disk. I'd like to launch that OS's Gnome Desktop in a second X server running on the same machine on a different tty than the ...
4
votes
0answers
124 views

Unable to view mounted directories in a chroot [closed]

Here is a quick description of what I have done: I have a chrooted user (username: clientdev) which I have jailed inside their home directory. This chroot directory is /home/clientdev/ which is ...
3
votes
0answers
253 views

Running (X) Xfce4 in Debian chroot

I was trying to start Xfce4 in a chroot. The problem is that Xfce4 starts, shows default the UI but the USB keyboard and mouse are not working. My chroot script: #!/bin/bash mount --bind /dev ...
2
votes
1answer
62 views

where does Cron look for the default mail binary?

I have setup Cron Jobs to run inside a Chroot Environment, depending on the User/Group; I have noticed that these cron jobs, running inside the chroot environment, fail to send any mail. Log files ...
2
votes
1answer
60 views

How do I limit local user file system access? What is the best method?

I have a Linux installation with a default user and an admin user (and root). On startup, the default user is automatically logged in and a particular application is launched. My intention is to ...
1
vote
2answers
76 views

How to create an environment for libraries and binaries?

I have a tool that cannot be run under my Desktop Linux. So I'd like to make a folder that contains all its requirements, and run it in the folder. Virtual machine or container is not a solution here ...
0
votes
1answer
104 views

Can I use a shell or python script to execute commands in a chroot?

I need: to make a shellscript which can chroot into a linux environment and run a command there. I am using: arch-chroot (on the arch linux livecd)
27
votes
2answers
13k views

Getting “Not found” message when running a 32-bit binary on a 64-bit system

I have currently a strange problem on debian (wheezy/amd64). I have created a chroot to install a server (i can't give any more detail about it, sorry). Let's call its path /chr_path/. To make things ...
9
votes
4answers
11k views

How can I chroot into a filesystem with a different architechture?

I'm trying to chroot into a Arch Linux ARM filesystem from x86_64. I've seen that it's possible to do using static qemu by copying the binary into the chroot system: $ cp /usr/bin/qemu-arm ...
3
votes
1answer
116 views

Backtrace of “git clone” running inside qemu-user-emulation based arm-chroot

I'm running a wheezy:armhf chroot using qemu user emulation on my jessie:x86_64 system. Somehow, a git clone on a particular private repository will hang inside the chroot, while succeed natively. ...