Skip to main content

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.

Filter by
Sorted by
Tagged with
1 vote
3 answers
212 views

Why it's recommended to run Postfix in a chroot jail?

I understand that chroot allows to isolate Postfix, so if an attacker gives an access to one of a Postfix program, he cannot maliciously change something outside of the chrooted directory. Seems that ...
Ilya Ordin's user avatar
1 vote
1 answer
165 views

Installed Ubuntu server 23.10 using debootstrap / chroot - on boot it fails to mount the correct root partition

I'm trying to work out a process for remote installation of Ubuntu Server. I want to have someone at the other end insert a flash drive and boot up, then I will ssh in and install. Here's the process ...
Jon Hulka's user avatar
  • 121
0 votes
3 answers
196 views

GNU Rush invalid uid

I'm trying to configure Rush for limited shell and scp access to a server I have. I am using Rush 2.3, fresh compiled. And the default config they have in their docs. Still, everytime I try to run a ...
jfreak53's user avatar
0 votes
0 answers
79 views

ACL permissions on Chroot directory

I have the Named service in a Chroot environment, I need a user to be able to modify the live files of the path /var/named/chroot/etc and I do not want to give full permissions with sudo, I have used ...
fah81's user avatar
  • 1
0 votes
1 answer
586 views

How to fix a corrupt server (after upgrade) with chroot in rescue-mode over ssh

First, I'm NOT trying to create a ssh-jail. Here's the situation I decided to upgrade my server from Debian 9 to 12. But now I'm locked out. I went step by step : from 9 to 10, 10 to 11 and 11 to 12, ...
Manumie's user avatar
  • 43
0 votes
1 answer
565 views

Using internal-sftp for a single user instead of all users?

I am setting up a restricted sftp user with chroot, the standard procedure works fine for me, however I have existing users using sftp on the same server, and that's why I don't want to take a risk ...
LAHOUEL Youssouf's user avatar
0 votes
0 answers
86 views

chroot vs home_folder in vsftpd

I'm using vsftpd, and I can't seem to get the behaviour I want through vsftpd.conf. What if you want /folder to be the change root folder to disallow users from going one folder up, but the starting ...
Jesse Stacey's user avatar
1 vote
0 answers
389 views

Availability of CHROOT in Docker containers and clusters

Is the Linux tool chroot generally usable in a Docker container running in clusters and cloud platforms? (background) I'm developing an application where I may need to use chroot inside a Docker ...
Matteo T.'s user avatar
  • 111
1 vote
1 answer
7k views

chroot:failed to run command '/bin/bash':No such file or directory on debian 12 live

I am using the Debian 12 live environment and have created a folder: mkdir /mnt/boot When I execute sudo chroot/mnt/boot, the following error is reported: chroot:failed to run command '/bin/bash':No ...
just a student's user avatar
1 vote
1 answer
248 views

Pure FTP Server let's me download files from "Bind Mounted HTML" folder but will thrown 533 Error to STOR command when uploading Index.html

Yesterday I finished configuring a FTP Server using Pure-FTPd. The method I am using is the "Virtual Users" method. The commands below are basically what I executed it in order to make it ...
Raul Chiarella's user avatar
0 votes
0 answers
377 views

(13)Permission denied: AH02611: create: apr_shm_create(/log/slotmem-shm-p24af65f1_0.shm) failed

I updated httpd to version 2.4.57. I compiled httpd on my own and when I start httpd within a chroot environment, I am getting this error message in the logs: [Thu Jun 22 14:33:27.319378 2023] [...
MrPython's user avatar
2 votes
1 answer
1k views

Use netns to bind programs to specific IP addresses

I have an IP address on my server, say, 192.168.0.3, I want to share in a net namespace, so to run apps there which will only be able to communicate to the internet using that 192.168.0.3. I can "...
Avenger's user avatar
  • 21
1 vote
2 answers
2k views

How can I set specific directory for different users in proftp?

Currently, when user A logs in proftp, he comes at his home directory /home/A, when user B logs in proftp, he comes at his home directory /home/B. I want to let user A come at /dir1 and let user B ...
peter's user avatar
  • 123
0 votes
1 answer
2k views

Can't chroot users correctly with vsftpd

I used this tutorial to install vsftp. Everything seems to work fine except for two things: Even though I set local_root=/home/$USER/ftp the default location when I use any ftp-client is /home/$USER. ...
MaestroMaus's user avatar
0 votes
1 answer
2k views

ubuntu 20.04 - ChrootDirectory in sshd_config wont work with tokens %h or %u

I am trying to lock users into their home directory using a dedicated group in the sshd_config. The section of my group looks as follows Match Group sftponly ChrootDirectory %h X11Forwarding no ...
azraelAT's user avatar
  • 103
0 votes
0 answers
207 views

Command logging for chroot ssh users

I have a ubuntu server that allows users access via ssh. When they log in they are contained to their chroot directory. I'm looking for a way to log commands used by the users. I've tried using snoopy ...
honepoyG8's user avatar
1 vote
0 answers
65 views

Tilde (~) shortcut in chroot jail

I have set up a chroot jail with bash for an ssh user. The "true" path of the home directory is /home/jails/home/name, and the chroot directory is /home/jails. When the tilde ~ shortcut is ...
Somphyr's user avatar
  • 11
0 votes
1 answer
173 views

OpenSSH ChrootDirectory man page remark on safety

In the sshd_config(5) man page in my system I found this remark in the section about ChrootDirectory: For safety, it is very important that the directory hierarchy be prevented from modification by ...
polettix's user avatar
  • 101
1 vote
2 answers
474 views

Debian unattended (preseed) installation, access to audio card(s)

I'm using the preseeding feature in order to shape a custom Debian 10 x64 system. Everything is happening well, except that during the late_command step, I'm running a shell script to configure and ...
Bil5's user avatar
  • 153
0 votes
1 answer
137 views

monitoring real time file access in chroot system

I was wondering if it's possible to write a shell script that: runs chroot for a given userspec and group monitors/intercepts system calls all processes started, and what libraries they attempt to ...
cestmoi's user avatar
0 votes
1 answer
5k views

Allow SFTP access to one or several directories for several users

For some of my users, I need to allow them SFTP access to one or several directories. Multiple users can have access to the same directory. But for directories they don't have permission for, they can'...
FlipFlap's user avatar
0 votes
1 answer
249 views

Is there another way to restrict SSH user other than chroot jail?

I need to create a safe environment for a foreign SSH user that has to have very restricted access to our server. That is: can only execute commands that are allowed can only use specific software ...
Ondřej Holík's user avatar
1 vote
1 answer
216 views

chroot not able to start service - not found. What is missing?

I would like to run a service inside a chroot in a NetBSD 9.1 amd64 system. The service runs if invoked from OS. The service in question is dendrite-monolith-server. I just copied the file for ease ...
Luis's user avatar
  • 283
0 votes
1 answer
426 views

sftp with Jailkit Connecting to host failed (exit status 4)

I'm running Ubuntu Server 18.04 with Jailkit 2.21, wanting to allow chrooted scp/sftp access via password to some users. The sftp client can authenticate OK, but then just disconnects with a "...
TommyPeanuts's user avatar
0 votes
1 answer
804 views

df shows low disk space. It includes a directory which uses mount --bind for chroot sftp

I've setup a chroot environment for sftp access (sftp only, no shell). The sftp user needs rw access to a host directory. I mounted it via /etc/fstab /var/www/html /home/sftp-user/jail/html none ...
RafaelKr's user avatar
  • 101
1 vote
0 answers
196 views

Annoying sftp chroot again (Ubuntu 20.04)

I think I understand all of the moving parts of not allowing a chrooted user over sftp to write to their own home directory (/home/username), but instead to write to an enclosed directory (/home/...
user603157's user avatar
0 votes
1 answer
1k views

SFTP Chroot write in chrooted /

Hey, I'd like to write with the chrooted user in his / but i can't. Example: i have /home/sftponly/ as ChrootDirectory Inside has to be another Directory with Permissions to this User, otherwise i ...
roseroserh's user avatar
1 vote
2 answers
4k views

OpenSSH + Active Directory: allow sftp for a group while disallowing everyone else

My objective is to allow a given Active Directory group members to use OpenSSH SFTP in chroot, and deny access to SSH for them and all others that aren't members of that group, while still allowing ...
Daichi42's user avatar
1 vote
1 answer
330 views

Performing an OpenSCAP Remediation via a chroot session -- "Can't perform remediation in offline mode" Error

I am attempting to perform an OpenSCAP remediation through a chroot session. My command is structured as follows: oscap-chroot /mnt/chroot_fs \ xccdf eval \ --remediate \ --...
TJ Zimmerman's user avatar
0 votes
1 answer
311 views

restrict access .ssh folder from the connected user

In complex setup where user connected to remote host using authorized private key, there is a .ssh folder with user settings and keys related to the remote host. Is it possible to disallow the ...
Robert Navado's user avatar
0 votes
1 answer
2k views

php exec returning 127 because /bin/sh is getting "Permission denied" in apache chroot

I have a php script that is trying to use exec (or shell_exec) to execute a binary on the system. The exec is failing with return code 127. Return code 127 normally means command not found. So I made ...
mhost's user avatar
  • 1,259
1 vote
1 answer
4k views

VSFTPD: set a user's default directory to NOT their chroot directory

I have a VSFTPD setup in which users are chrooted to their home directories. Standard stuff. But this requires all of their home directories to be unwritable to them (to avoid security issues.) No ...
Eliezer Miron's user avatar
1 vote
0 answers
70 views

Install Linux on a second disk from an already running Linux (RHEL 7.8) instance

I am trying to mount a second disk on a running Linux (RHEL 7.8) AWS instance, install a customized bootable Linux environment to it, and then change that disk to an AMI so we can boot new Linux ...
ALittleStitiousPuppet's user avatar
0 votes
1 answer
197 views

Configure multi-level sftp access

I'm setting up a sftp server where clients will only have read-only access. They will log into their chroot directories, which is fine, but I need an admin account that can access/write to those ...
iGuy's user avatar
  • 1
1 vote
1 answer
4k views

How to specify user home in sshd config?

I have my sftp users chrooted into /var/www and I would like for them to be automatically moved into their directory. I found this answer which helped me a lot: Chroot SFTP - Possible to allow user to ...
leonheess's user avatar
  • 144
0 votes
1 answer
1k views

AWS EC2 Linux restrict SFTP user to their home directory when users connect from WinSCP

I'm working on a solution to restrict the user to the home directory or a specific directory. I need to restrict a user for below scenario, we have multiple Wordpress installation in webroot /var/www/...
KNCK's user avatar
  • 1
1 vote
1 answer
488 views

PHP-FPM chroot - one pool for all nginx virtualhosts

Now we have multiple virtualhots (nginx) under one php-fpm pool. We would like to use it same way with chroot. Chroot directive is absolute path /var/www, but chdir should be /[domain]/httpdocs Is it ...
andrew's user avatar
  • 295
0 votes
0 answers
32 views

Setting up account to upload to a website subdirectory

I need to setup a stfp account on Ubuntu 18.04 that meets the following requirement: Can upload to subfolder of website i.e. example.com/subfolder/ Uploaded files belong to www-data group so are ...
Guerrilla's user avatar
  • 263
2 votes
0 answers
413 views

Setting up virtual users with vsftpd

I'm trying to set up virtual users for an FTP server in a Linux box, but I'm not sure if the server I've picked up (vsftpd) can do what I need. My requirements are: The FTP accounts are inside a ...
PaulJ's user avatar
  • 161
1 vote
0 answers
97 views

KSH/Bash History for jailed SSH users

How can I keep a history of activities for chroot'd SSH (not SFTP) users? I've tried: created a .sh_history in their home with the proper permissions created a custom $HISTFILE in .profile and in its ...
Dumb  admin's user avatar
0 votes
0 answers
2k views

Running docker from within a chroot

I am trying to build a distro for RaspberryPi which ships with an aarch64 chroot running docker. For this to work, I need docker to run within a chroot. I am basing of rasbian, which is distributed ...
GuySoft's user avatar
  • 435
0 votes
1 answer
1k views

Why does internal-sftp verbose logging not include rename, move and delete operations?

I have configured a CentOS 7.7 installation to use the internal-sftp subsystem and to chroot a specific user in to a particular folder. I want to enable logging, so I configured sshd like this: ...
jamieburchell's user avatar
1 vote
1 answer
4k views

Restricting SFTP users (OpenSSH-based) to a custom port only

I understand that there have been tons of other threads on the Internet on allowing OpenSSH SFTP connections on a custom port. I've hit them, not all, but a lot. And have not been able to make it work ...
Tung Nguyen's user avatar
0 votes
0 answers
485 views

Allow SCP/SSH to a chrooted environment only?

Is there a way to do this without installing a package like rssh or scponly, as they seem woefully out of date and full of security problems? Is there any newer tool I could use? ssh is an optional ...
Paul's user avatar
  • 253
2 votes
1 answer
1k views

Chrooted SFTP user can't login

I'm trying to configure a user who will only be able to access to an specific directory. I've configured a Chroot jail in SSH and changed its home directory, but configuring the internal-sftp with ...
Zarovich's user avatar
0 votes
1 answer
3k views

Execute half of the %post section of a kickstart in a nochroot environment and the other half in a chroot environment

I am trying to execute a script that performs certain security configurations on my recently installed system. Much of the script refers to files starting with / as the base directory which presents ...
peachykeen's user avatar
1 vote
0 answers
390 views

How do I remove a kernel package from an image chroot if it's the kernel running on my build host?

I am trying to build a custom image using diskimage-builder, and amongst other things, that tool updates all the packages within the image to the latest version, including the kernel. It also uses ...
Drulgaard's user avatar
0 votes
1 answer
1k views

LocalForwarding on a SSH connection from my desktop client to a CHROOTED user in an LXD container

I currently have a proxified web host setup for local development, yet I'm trying to make it a proper (documented) setup so I can deploy it on practically any VPS hosting. Currently everything else ...
Elias's user avatar
  • 1
1 vote
2 answers
1k views

Configure cron jobs for the chrooted user

I've configured chrooted SSH user on CentOS 7. Mounted /proc, /dev, /dev/pts to the user and installed required packages. And now I want to allow cron jobs for this user. How can I solve the task? ...
kurgulus's user avatar
2 votes
1 answer
2k views

Ubuntu root password reset

I have a dedicated server that i've just setup at Hetzner. I've done the stupid thing of not changing the temp password they give you and disconnected from the SSH session. They don't send nor store ...
Nathan's user avatar
  • 165

1
2 3 4 5
9