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.

-2
votes
0answers
5 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
26 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
29 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
18 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
39 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
16 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
38 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
28 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
32 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
71 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
56 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
139 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
100 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
40 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
89 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
134 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
104 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
124 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
255 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
240 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
60 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
245 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
158 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
32 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
117 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
144 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
58 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
321 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
129 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
146 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
846 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
495 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
534 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
830 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
48 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
57 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
370 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
939 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
142 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
86 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
77 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
135 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
142 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 ...
1
vote
1answer
193 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
77 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
119 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
75 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 ...