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.

Filter by
Sorted by
Tagged with
2
votes
0answers
36 views

Is there a simple way to redirect access to a particular system file for just one program? [duplicate]

The obvious solution is to recreate the whole filesystem except one file and use chroot. But may be there is a simpler hack for doing this. My usecase is, to cheat a program to use a special /etc/...
2
votes
0answers
18 views

ENOSPC when binding root in chroot

I'm using a custom script to enter a chroot environment (this is not a security jail; it exists so that I can compile and do a few other things with a controlled set of installed packages and tools ...
1
vote
0answers
25 views

Can I interpret Grub2's post-MBR gap?

While setting up a RAW disk image for use in a QEMU-based virtual machine, I became frustrated because QEMU would load GRUB but then GRUB would not load a menu of OSes to boot into. I've come to the ...
1
vote
1answer
41 views

How to run lxc inside of a chroot

I'm trying to run lxc inside of a chroot. $ lxc-start -n instrument --logfile=/dev/stdout lxc-start 20190619141851.659 ERROR lxc_cgfs - cgroups/cgfs.c:cgfs_init:2359 - cgroupfs failed to detect ...
1
vote
1answer
49 views

What is the difference between minimal and full chroot?

While installing a linux distro I found many types of tar.gz files. But I found that, about every distro (For Different architecture) has two files indicated with minimal.tar.gz and full.tar.gz I have ...
1
vote
1answer
70 views

How to run nmap from inside a chroot?

While I am trying to run nmap with privilege this message is showing: nmap: netutil.cc:3285: int route_dst_netlink(const sockaddr_storage*, route_nfo*, const char*, const sockaddr_storage*): ...
0
votes
1answer
38 views

Exit chroot from script

My script creates a chroot cage to install GRUB to a USB, run as sudo of course: SYSTEM_DIRS=(etc bin sbin var lib lib64 usr proc sys dev tmp) boot_partition=/media/user/boot for dir in ${...
0
votes
0answers
25 views

Moving MBR to a cloned drive with BTRFS

Context : I have cloned a disk with ddrescue (was supposed nead to death). I want the copy to be bootable. Both disks are installed in the PC, the old one (eventually in good health) on /dev/sdb and ...
0
votes
0answers
23 views

How can I lock an FTP user to their home directory?

I have found some help regarding locking an FTP user to their home directory, but after following steps, I find I'm still able to run cd .. and exit that directory and browse the file system. I'm ...
0
votes
1answer
56 views

NixOS: Modifying config files on a buildFHSUserEnv environment

On NixOS, I'm using a FHS environment to supply libraries (unixODBC and sqlite-odbc) to libreoffice. { pkgs ? import <nixpkgs> {} }: ( pkgs.buildFHSUserEnv { name = "odbc-sqlite-libreoffice";...
0
votes
0answers
10 views

creating a chroot sftp user connecting to a different directory

I created a user and added it to its own group at the bottom of my sshd_config i added Match Group sftpusers ChrootDirectory /var/dir1/dir2 ForceCommand internal-sftp However, it gives ...
-1
votes
1answer
33 views

is it safe to run yum and install packages when the root file-system isn't that of the running system?

Example: I have a centos or debian X.Y installed on physical disks, with a 2.6 kernel. Now I put a "live distro" ISO (example archlinux) on one DVD and boot the system from the DVD, so now the ...
0
votes
0answers
30 views

Chroot directory and all of its parents must be owned by root?

I was under the impression that for chrootdirectory to work: The chroot directory and all of its parents must not have group or world write capabilities (ie chmod 755) The chroot directory and all of ...
1
vote
1answer
44 views

debootstrap chroot x11 cannot open display 0 no protocol error

after installing a chroot, I found trouble when connecting to x11, I would think this was a normal use case but coudln't find anything specific about this use case # debootstrap stable /srv/stable/ .....
1
vote
0answers
73 views

Chroot Jail User | Allow access via ssh shell

How to allow chroot Jail users(sftp) to access terminal through SSH. The user will placed file via WinSCP (chroot Jail).then on same server login to putty(ssh) there is a script that will launch ...
1
vote
0answers
45 views

Unable to create chroot in Ubuntu [closed]

While trying to create chroots using: '/usr/bin/schroot --chroot source:mini-buildd-licensing-1-amd64 --user root -- /bin/sh -c "echo 'deb http://repomanager.xxx.com:8082/ licensing-1 main' >/etc/...
0
votes
0answers
24 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
88 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
41 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
68 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/...
0
votes
1answer
101 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
15 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
243 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
36 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
149 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
23 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
99 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
97 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
35 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
211 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
103 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
501 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
175 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
107 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
261 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
320 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
277 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
161 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
597 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
76 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
879 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
76 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
510 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
302 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
45 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
216 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
203 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
70 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
458 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
242 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 ...