Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [chroot]

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.

39
votes
4answers
326k views

Limit FTP access only to the /var/www with vsftpd

I am running vsftpd as ftp server on my linux (rasbian), I log in to the machine as a root user. I would like to be still locked to using only /var/www, how can I configure vsftpd conf to accomplish ...
11
votes
1answer
3k views

Why do I need to use chroot

This question chroot-jail-what-is-it-and-how-do-i-use-it refers to what is and how to use chroot. What I don't understand is why do I need to use chroot. I understand what it does, but I can't think ...
0
votes
1answer
2k views

Setting up logging for chroot users

I have tried a few tutorials on this, but cant seem to get it to work. I would like to log user activity (change dir, upload/download file etc) for chroot users who are in a chroot jail. My current ...
2
votes
0answers
33 views

name resolves doesn't work in chroot for users, but does for root

I've booted a live-cd in order to download, compile and install a few packages on a otherwise working system without actually booting said system. I've created a build user on the system by issuing ...
46
votes
5answers
169k views

chroot: failed to run command ‘/bin/bash’: No such file or directory

When I run the chroot command an error is given: failed to run command ‘/bin/bash’: No such file or directory
-6
votes
1answer
58 views

Is chroot an example of application virtualization in Linux?

I am not very certain about the concept of Application/Process Virtualization. To help with that, what are some examples of application virtualization in Linux? (https://en.wikipedia.org/wiki/...
-1
votes
1answer
35 views

Does chroot need any special kernel support?

docker is said to be a steroid version of chroot. Does chroot need any special kernel support, e.g. namespace, cgroup? Does docker rely on chroot? I ask this because "Docker is not virtualisation: ...
0
votes
1answer
548 views

systemd-nspawn vs chroot and bind mount?

Does systemd-nspawn do special inside to a chroot or does it just provide a different method of running chroot + the appropriate ro --bind mounts for proc, sys. The docs say, similar to chroot(1), ...
4
votes
1answer
2k views

What are the dangers of having writable chroot directory for FTP?

People around the net are all yelling how insecure it is to have writable root FTP directory, if you configure your FTP server with the chroot option (vsftpd won't even run). I miss the explanation ...
5
votes
3answers
10k views

Unable to reach network from chroot

I have a complicated scenario, with most of the complicated parts working: SD card contains a Fedora 23 Raspberry Pi install on a LUKS/BTRFS filesystem. Fedora 23 x86-64 VM being used to manage the ...
-1
votes
1answer
2k views

Virtualbox Not working Modules not working

So i am trying to install genymotion on ubuntu 16.04 and i need the modules running so i open up virtualbox, i get some warnings so i reinstalled virtualbox-dkms and i checked my headers which i got ...
7
votes
3answers
413 views

Why is chroot(2) unavailable to unprivileged users?

Why is chroot(2) unavailable to unprivileged users? I don't understand existing answers on the Internet. For example this one https://lists.freebsd.org/pipermail/freebsd-security/2003-April/000123....
-2
votes
0answers
7 views

Change color of chroot prompt in LFS

I am currently building an lfs and am in the 6th chapter. I am using ssh and a remote droplet for making the lfs. I have a tiny problem that while i am in the chroot environment, the prompt color is ...
0
votes
1answer
33 views

umount filesystem when exit from chroot

Is there a way to automatically unmount a filesystem when doing 'exit' command from a chroot? $ mount --bind /proc proc $ chroot . ~ exit #now in chroot and call exit. $ # back to main device. I ...
0
votes
1answer
14 views

Force SFTP user to login to specific dir

The end goal here is to have an sftp user that logs into /home/user1/data I have followed the instructions at the link below and they do work: https://www.vultr.com/docs/setup-sftp-only-user-accounts-...
1
vote
1answer
2k views

Run Java in a chrooted jail

I'm on a CentOS 6.5 machine with Plesk Panel which I used to create a chrooted environment for a user who can access it via ssh. I managed to let him use some basic non chroot standard command like ...
2
votes
1answer
958 views

Arch - How do Install a package made in a clean chroot?

I've been trying to build and install GNU Icecat from source on Arch linux using yaourt, but I've recieved errors during the build relating to the Infinality font set. I came across this page from ...
0
votes
1answer
1k views

SFTP not logging to /var/log/sftp.log

This article (Setting up logging for chroot users) is the only one that has helped me to get logging working for chroot'd sftp users, so huge thanks for that! However, for some reason, my logs ...
1
vote
0answers
71 views

No user exists for uid 721001106 when running ssh command within SSH chroot directory

I am running debian 8 with SSSD authentication. The authentication works and ssh works fine. I have copied all libraries etc over to my SSH chrootdirectory and all my applications work except ssh ...
3
votes
2answers
471 views

Denying “/opt/” access for SFTP Users other than particular dir

I want to use my WebServer (Debian) as SFTPServer giving access to particular employees. The dir structure is as follows under root: /FTPUSERS/UserName_1, ... /FTPUSERS/UserName_N. My website is ...
1
vote
1answer
211 views

Jail in chroot in debian 7.5 - Privileges Separation problem

I'm trying to create a jail for a user in my server. Let's call the user "juser". What do I want to achieve? I want an ssh user to be jailed in his home folder and not have any access (whatsoever) on ...
0
votes
2answers
711 views

Cannot create root jail

I just tried to play around with chroot command only for testing purposes, in order to create a temporary root jail, but I didn't managed to. The platform is CentOS 6.4. and I have done it numerous ...
3
votes
1answer
1k views

SSH with chroot and only working “sftp”, “rsync” (both)?

I have two users and one shared folder in my Ubuntu server: User writer, which has write access to /var/shared. It's an application regularly making file changes in this folder from remote, with SSH ...
1
vote
1answer
22 views

GNU Screen requires different permissions for chroot environment? /run/screen

I have my computer start secure shell in a chroot system at boot. (All the normal directories are bind mounted in the chroot system /run, /dev, /dev/pts, /sys, /proc). After logging in to the chroot ...
2
votes
1answer
1k views

Restrict SFTP users to different directories

How can I restrict some users/groups to some directories? I mean different users, different directories. What I have: Ubuntu 14. Experience with Ubuntu: Just started. What I have tried: I read this ...
0
votes
1answer
58 views

SFTP SELinux ssh_chroot_full_access

I always configured SFTP on Centos 6 like this: https://www.linuxtechi.com/configure-chroot-sftp-in-linux/ Where in the comment this item appeared: setsebool -P ssh_chroot_full_access on From the ...
0
votes
1answer
19 views

SFTP: chroot jail with different ownership

SFTP directory - /qon/app/report Ownership of the /qon/app directory is tom:qcc I cannot change the ownership to root:root as there are a lot of applications that depend on it. Is it possible to ...
1
vote
1answer
122 views

Trouble setting up an sftp chroot jail

I'm following the SFTP chroot wiki on ArchWiki and finding a huge snag: I can't get my sftponly users authorized. Output of tail -2 /etc/passwd (my 2 users): chris:x:1001:1002::/home/jail:/usr/bin/...
0
votes
0answers
46 views

Logging Chrooted Users SFTP Activity

So I'm having the issue where I can't seem to log users SFTP activity. I can see when a new session was created by a specific user, but can't see where they've been or what they may have dropped ...
0
votes
0answers
34 views

chroot multiple directories in linux using active directory groups

I have integrated a linux server with Active directory. I have multiple Active directory groups created sftpgroup1, sftpgroup2 and sftpgroup3. UserA is part of sftpgroup1 and sftpgroup2. I am trying ...
0
votes
2answers
3k views

Install chroot in a user-defined directory

I want to install chroot in a custom directory. I am using kali-nethunter in my Android 6.0. Problem is I am running out of internal storage. So can't install more packages. Nethunter is installed in ...
0
votes
0answers
33 views

Securing an open FTP on FreeBSD for visitor wifi speed testing?

I'd like to add a really simple local FTP server to my FreeBSD system, to allow guests to do wifi speed testing. Because of the use, I don't need more than very basic functionality - anon R/W to a ...
0
votes
1answer
68 views

Automount ecryptfs home in chroot (when using schroot)

my host system is archlinux and i need an ubuntu enviornment ready to be used with the files in my home directory. Problem is: my home directory is encrypted using ecryptfs. So when i launch the ...
3
votes
2answers
4k views

How to set up chrooted and non-chrooted sftp?

I am trying to set up my Openssh server to allow for chrooted sftp-only users as well as for non-chrooted sftp and ssh users. My condensed (comments and blank lines removed) /etc/ssh/sshd_config looks ...
0
votes
0answers
109 views

Chrooted upload-only SFTP account - what requests to blacklist/whitelist?

I'm trying to make a chrooted SFTP account which could allow only upload of files into an unique directory - ie. /upload/$timestamp. Let's imagine that it is a shared upload account where one can ...
0
votes
0answers
20 views

Change permissions of /opt folder [duplicate]

I would like to change permissions of /opt folder to 775 (or 777). Enabling the user to modify its content. Is this ok or does that pose a security issue?
6
votes
1answer
1k 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 ...
0
votes
1answer
154 views

use chroot to lock down sftp access without root owning folder

Everything I am reading says that for chroot to work with sftp root has to own the folder. I want to make it so a user can only sftp to a sub-directory in their home folder like /home/user/some/folder....
3
votes
1answer
1k 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 ...
1
vote
2answers
343 views

Error when executing scripts within chroot environment [closed]

i wrote a small script to remove and purging some packages and install new one within chroot environment(debian 9), but when i run the script i got this error when the script running the purging ...
1
vote
0answers
205 views

sshd_config - StrictModes option - bad to disable?

My use case is to have a shared account for webmasters (named as domain) but only one of the webmasters is "owner" of main data and defines who can loging to the shared account via editing ...
3
votes
0answers
52 views

How to make unshare(CLONE_NEWUSER) succeed after chroot?

My call to unshare(CLONE_NEWUSER) when called as a non-root user returns EPERM because of this (http://man7.org/linux/man-pages/man2/unshare.2.html): EPERM (since Linux 3.9) ...
13
votes
2answers
3k 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 ...
3
votes
0answers
172 views

How to escape from a hardened chroot on Linux when only file capabilities are available to the attacker?

There is a chroot environment in /var/myroot, and an attacker has obtained arbitrary machine code execution in a process running as root (EUID 0) in the chroot. But the processes under control of the ...
1
vote
2answers
123 views

How to create a chroot from which root cannot escape using chdir(“..”) on Linux, inside a filesystem?

I have a directory /var/mychoot on the same filesystem as /, and I've started the program /var/mychroot/prog as sudo chroot /var/mychroot /prog, so the program is running as EUID 0. If the program ...
10
votes
1answer
959 views

How to perform chroot with Linux namespaces?

After reading about Linux namespaces I was under the impression that they are, amongst a lot of other features, an alternative to chroot. For example, in this article: Other uses [of namespaces] ...
6
votes
1answer
8k views

loadkeys says “Couldn't get a file descriptor referring to the console” in chroot on ChromeOS

I've been trying the "Developer console" in ChromeOS( dev mode), which is entered by Ctrl+Alt+Forward but when switching the keyboard layout with loadkeys cz I got an error saying Couldn't get a file ...
2
votes
1answer
2k 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 ...
2
votes
2answers
4k views

How to use bindfs to create a shared folder between a chroot environment and its host

I want to use bindfs (or any viable alternative) to solve the following problem: I have a local folder that contains a maven project I am working on. However I can only build in a chroot environment (...
46
votes
3answers
25k views

How do I tell I'm running in a chroot?

I have a unix installation that's supposed to be usable both as a chroot and as a standalone system. If it's running as a chroot, I don't want to run any service (cron, inetd, and so on), because they ...