Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
0answers
38 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
0answers
29 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
21 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
45 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 ...
1
vote
0answers
60 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
34 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
81 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
0answers
42 views

Issues with apt and aptitude on debian jessie (chroot environment)

i have a chroot debian os running on my rooted android phone, i recently tried installing InstaPy on it and ran into the following errors root@localhost:/# cd InstaPy root@localhost:/InstaPy# python3 ...
0
votes
1answer
107 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
51 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 ...
-1
votes
0answers
25 views

utmp and chroot

I'm trying to chroot in this way: cloc3Lnv ~ # LC_ALL="C" chroot --userspec=chrootuser:user /var/chroot I have no name!@cloc3Lnv / $ id uid=2707 gid=100 groups=100 Unlikely, the user "chrootuser" is ...
0
votes
2answers
76 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
50 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
119 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
84 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
0answers
97 views

groupadd --root vs. chroot + groupadd

I am trying to prepare an image with buildah, but I am running into a problem with creating a new group inside the container. buildah mount created a resonably healthy looking dir structure at /var/...
0
votes
1answer
28 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
59 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
0answers
29 views

chroot vs. schroot for running a script on an external hard drive

In short, if I have an external hard drive mounted under another Linux OS, and I want to run a script on that hard drive, will it be better if I use chroot or schroot? The longer story... I have a ...
0
votes
1answer
102 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
49 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
255 views

Error when executing scripts within chroot environment [on hold]

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
61 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
77 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
504 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
327 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
447 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
556 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
41 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
39 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
261 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
610 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
108 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
70 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
0answers
84 views

SMB via Crouton - how to make this work?

I have Samba set up on a Raspberry Pi and I would like to use it as a small file server to extend the amount of storage space I have available for my Chromebook from within crouton. I am able to ...
0
votes
2answers
67 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
111 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
89 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 ...
0
votes
1answer
138 views

What rule prevents entering a user namespace from inside a chroot?

# rpm -q --whatprovides /usr/bin/unshare util-linux-2.32-2.fc28.x86_64 # unshare -r # i.e. the above succeeds, where the following does not. What rule causes this? # rpm -q --whatprovides /usr/sbin/...
0
votes
1answer
59 views

How to copy/paste list of commands with chroot

I want to create a script that executes the following commands, one after the other. The problem is the chroot command: everything after that command is not copied into the chroot environment as I ...
0
votes
0answers
105 views

Modify existing overlay mount

Is it possible to insert additional lower layers to an existing overlayfs mount? The idea is to add new features to a running "chroot" so that they immediately see these changes in their root fs ...
0
votes
1answer
58 views

Docker | Chroot jail questions | Node.js kind of hosting

Ok so I'm using Docker and I'm not familiar w/ Chroot jail yet. I have Docker image w/ installed Debian / Node.js. But I want that every single Debian user can run their own Node.js application w/o ...
1
vote
1answer
194 views

Security implications of chroot()

I want to setup a small FTP server for personal use, and decided to use vsftpd for that. I thought that I should enable chroot_local_user, so users are chrooted to their home directory upon login. ...
0
votes
0answers
24 views

Mono Nuget Assembly Error in Linux

My questions is about the microsoft mono package and using it with NuGet. Long story short, I'm hoping I can have a working .NET Engine for a couple of games I wanted to install that requires this. ...
0
votes
0answers
60 views

MIPSEL statically linked binaries

I'm having trouble running MIPSEL binaries on an ARMEL machine. I am using the Debian "Wheezy" distro. I added the "foreign" architecture (MIPSEL) to the system. What's strange is, when I chroot into ...
2
votes
1answer
437 views

How can I fix “mount: /mnt/proc: permission denied” error during arch chroot installation using “proot”?

I'm trying to install arch using proot(instead of chroot). I'm following arch wiki. Steps I've followed: 1. Downloaded and extracted arch bootstrap file. 2. Instead of using arch-chroot script in the ...
0
votes
2answers
90 views

How is a root directory used for resolution of absolute pathnames?

APUE says Each process also has a root directory that is used for resolution of absolute pathnames. This root directory can be changed with the chroot function. I thought only ...
0
votes
1answer
82 views

Application crash in chroot jail

I have a Debian 9 installation with a Debian 6 chroot jail. I am using a proprietary application which up until recently worked fine in the jail. But when I run its newer versions, it crashes in libc. ...
0
votes
0answers
39 views

Starting Script at FTP login

I run a vsftp server on Debian and connecting with FTP over TLS. all allowed users are jailed in a chroot after login. Now i want to mount different folders inside the users chroot. For every single ...