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.

0
votes
0answers
22 views

How to run 2000 processes with chroot

I have a program that needs to be run in about 1000 instances, each in a different independent directory (/mnt/x_1, /mnt/x_2... /mnt/x_1000). What I'm currently doing is mounting /bin /dev and /etc in ...
2
votes
0answers
35 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 ...
-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: ...
-7
votes
1answer
59 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/...
-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
35 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
0answers
79 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 ...
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 ...
0
votes
1answer
63 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
20 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 ...
0
votes
0answers
47 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
36 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
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
0answers
114 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
1answer
69 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 ...
1
vote
0answers
218 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 ...
1
vote
1answer
124 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/...
3
votes
0answers
58 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) ...
1
vote
2answers
129 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 ...
3
votes
0answers
178 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 ...
0
votes
1answer
164 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....
0
votes
1answer
134 views

chroot command: failed to run command ‘node’: No such file or directory [closed]

I run this command at the command line: $ sudo chroot . node test/simple.js And I get this error: chroot: failed to run command ‘node’: No such file or directory makes sense, since the node ...
0
votes
1answer
325 views

No internet connection in chroot environment (customizing iso)

I want to customize a Ubuntu Desktop Iso and I have come that far, that I am in the chroot environment. The problem is that I do not have Internet access in there to install anything. I just can ...
-1
votes
1answer
72 views

How consider home folder as root folder?

I create users who each have their own home directory, normal. Currently I create my user as follows: adduser -d / home / ftp / myUser myUser My users need to connect to SFTP (open ssh installed on ...
0
votes
2answers
337 views

ldd shows no location after arrow; library does not exist on system

I want to create a chroot environment that has access to hand-picked programs but is completely isolated from the rest of the system. I created three folders in this chroot folder: bin, lib, lib64. I ...
0
votes
1answer
66 views

For pivot_root I want to kill all processes oldroot is using so that I can detach MTD partition.. and exit shell and go back in

I have an embedded linux on arm7. I have a rootfs mounted on MTD partition 10 (for example), i.e. /dev/mtd10, which is a flash device. The volume is UBIFS device UBI0 (/dev/ubi0). I have setup a ...
0
votes
1answer
307 views

Chroot SSH - Command not found

I have a bin directory in my chroot directory that contains commands like bash date ls...etc If i simply chroot to my chroot directory. i am still able to invoke commands listed in the /bin. However ...
1
vote
1answer
206 views

How to use Jailkit Jail Manager in Virtualmin to restrict users

How to use Jailkit Jail Manager in Virtualmin (Webmin 1.892) to restrict users in their homes including virtual website and all services running under user? I am setting up small website hosting ...
0
votes
1answer
34 views

Redirect output without telnet information to file

I am trying to download a binary file from an HTTP server with GNU Telnet, a tar archive to be exact. I can currently download regular files, but I can't properly redirect the output to a file. The ...
-1
votes
2answers
134 views

Switch back and forth between chroot jail and Host in the same terminal

I have a created a chroot jail in my Ubuntu 14.04 machine using schroot and debootstrap. Now I want to write a shell script that goes back and forth between my native environment and the chroot. ...
0
votes
1answer
163 views

How to create a restricted shell for a specific user

I'm trying to create a restricted shell for a maintenance user. This user should only be allowed to execute a single bash script within his home folder. The user should not be allowed to execute any ...
1
vote
1answer
62 views

chroot + mount = EBUSY

I have a large, complex application. I'm trying to run it from a boot CD, which is obviously read-only. But the application needs a large writable area. (A ramdisk won't cut it.) So I've managed to ...
1
vote
2answers
348 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
1answer
156 views

Is a Chroot Jail for SSH *and* SFTP?

I'm trying to setup a chroot jail, but I'm not sure how to make this work in SSH and SFTP. A quick question, will something like this work for both SSH and SFTP or just SSH? If it doesn't work for ...
0
votes
0answers
170 views

using debootstrap to create rootfs offline

I want to create debian filesystem offline (downloading only once). I am on a Ubuntu system and have tried the following : sudo apt-get install debian-archive-keyring Making the tar ball of the ...
1
vote
2answers
983 views

Running systemd utilities like systemctl under an nspawn?

If I have a directory that I bootstraped with debootstrap that I got inside of running systemd-nspawn what do I have to do make its internal systemd functional? $ sudo systemd-nspawn -D ./foo ...
0
votes
1answer
555 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), ...
0
votes
1answer
590 views

Run systemd script in chroot from outside the chroot?

Is it possible to run a SystemD service with a different root? For example if I use debootstrap to install a parallel distro, and inside that distro is a systemd service I would like to run, is there ...
10
votes
1answer
976 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] ...
1
vote
0answers
51 views

What is obvious security vulnerabilities running guix-daemon as root? [closed]

Here was recommended to use pool of build users because of security reasons https://www.gnu.org/software/guix/manual/en/html_node/Build-Environment-Setup.html#Build-Environment-Setup Please, which ...
1
vote
1answer
65 views

Bash in chroot strange key movements

I'm trying to set up a chroot environment with only bash in it. This is what I have so far: [root@free]# tree . . ├── bin -> usr/bin/ ├── dev ├── etc │   ├── bash.bash_logout │   ├── bash.bashrc │ ...
-2
votes
2answers
438 views

Chroot : no such file or directory [closed]

I know it has been asked before but they do not solve my problem. I have already binded the /dev and /proc, copied the qemu-arm-static to /usr/bin. But chroot fails at executing any command. It was ...
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
1answer
160 views

I don't understand how entering a mount namespace can work

either if you fork into a new mount namespace, or enter an existing one. It is possible to hold file descriptors from a foreign mount namespace. You can demonstrate this very easily, by finding a ...
0
votes
1answer
88 views

Lazy unmount root jail drives

I have created a root jail containing rpm and yum (centos 7.5) to install some software on the original system. Workflow Mount sys, proc, dev to the root jail Mount root of the original system "/" ...
14
votes
3answers
1k views

Why would I chroot for sandboxing for security if my application can from the beginning run at a lower level?

I am writing an HTTP server daemon in C (there are reasons why), managing it with systemd unit file. I am rewriting an application designed 20 years ago, around 1995. And the system they use is that ...
0
votes
2answers
80 views

Making a bind-mount take effect only in the context of the current process and its descendants

I have 2 files: /MyDir/a and /MyDir/MySubDir/b and am running a bash script, to which I want to add code to make file /a point to file /b, but only in the current process and its descendants. In ...
0
votes
1answer
154 views

using a chroot jail to change the results of uname -n

I just learned what a chroot jail is so excuse me if this questions doesn't make much sense. Basically I have two processes running locally in my machine and would like the results of "uname -n" to ...
0
votes
2answers
162 views

What are limitations chrooted system? [closed]

Chroot allows us to change the root directory, or rather root directory of specific process. Now obviously this does restrict the process to the specified tree (unless it doesn't relinquish the ...