As of May 31, 2023, we have updated our Code of Conduct.

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
0 votes
0 answers
83 views

PHP-FPM + Apache2 security

I have configured my server (an Ubuntu 22.04 machine) so that it is managed by Apache (v2.4.55) and php7.4-fpm. The current configuration allows every vhosts to be divided into specific php-fpm pools, ...
MrL's user avatar
  • 1
2 votes
1 answer
173 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
1 answer
197 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
  • 83
0 votes
1 answer
432 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
0 answers
71 views

Can you use ostree to manage chroots?

I've recently started managing a personal server running a fedora derivative. I really like the idea of ostree, but the toolbox seems to get in the way more than I'd like for the tasks I'm working on. ...
rr0s's user avatar
  • 1
0 votes
1 answer
580 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
140 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
50 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
106 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
296 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
  • 143
0 votes
1 answer
74 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
2k 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
180 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
176 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
  • 273
0 votes
1 answer
330 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
539 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
176 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
652 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
3k 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
252 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
264 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,169
0 votes
1 answer
2k 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
44 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
150 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
2k 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
921 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
366 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
  • 285
0 votes
0 answers
23 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
  • 243
2 votes
0 answers
331 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
  • 151
1 vote
0 answers
75 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
1k 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
896 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
3k 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
328 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
907 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
2k 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
302 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
999 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
0 votes
0 answers
393 views

Issue Hardlink/Junction not working when chroot all users to c:/share dir in Windows OpenSSH Server 2019

Issue Hardlink/Junction not working when chroot all users to c:/share dir in Windows OpenSSH Server 2019. Link Created mklink /d E "E:" mklink /d F "F:" Entry in sshd_config file ChrootDirectory c:/...
user524121's user avatar
1 vote
1 answer
281 views

Jailkit/Chroot - Allow Less and More

I have the need to add the LESS and MORE commands to a jailed-user. I've attempted the following and can't quite get it to work: # which less;which more /usr/bin/less /usr/bin/more Now that I ...
user2643864's user avatar
0 votes
2 answers
1k views

Publish network services using Systemd machinectl

TL;DR: How to expose network services to the host through machinectl/nspawn containers? I'm trying to make things perfectfor my setup, i.e. installing my services in separated chroot instances. To ...
moutonjr's user avatar
  • 498
3 votes
1 answer
5k views

chroot, gpg-agent, and Ubuntu 18.04

For SFTP access to my server, I have created a sftp user that is limited to a working directory by chroot. Match User sftp-user AuthorizedKeysFile /home/sftp-user/.ssh/authorized_keys ...
BurninLeo's user avatar
  • 880
0 votes
2 answers
1k views

vsftpd with chroot_local_user requires client certificate

When setting up my FTPS server I want to enable chroot_local_user. When disabled everything works fine. If I enable this however, WinSCP fails to connect and claims I need a client certificate to ...
ThaChillera's user avatar
2 votes
0 answers
241 views

internal-sftp on chroot jail disconnects with status 1?

Server: Ubuntu 18.04.1 LTS SSHD: OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n I have created a test user sftpuser and sftp group to try logging in through a WinSCP client, as a start. In sshd_config I ...
Sasha's user avatar
  • 21
0 votes
1 answer
514 views

OpenSSL-related linker error while building PHP 5.3.3

While trying to build PHP 5.3.3 on Debian jessie (save yourself some sanity by not asking why) with OpenSSL extension enabled, I encountered undefined reference to symbol 'X509_free@@OPENSSL_1.0.0' in ...
user2845840's user avatar
0 votes
1 answer
1k views

Segmentation fault when building centos 5 chroot [closed]

For some legacy application I decided to use chroot with CentOS 5. I did install CentOS 5 on virtual machine, then I boot virtual machine with live CD and using tar, I "copied" the files from the ...
Nick's user avatar
  • 804
0 votes
1 answer
1k views

mariadb in chroot gives Access denied for user 'root'@'localhost' even though password is set

I have a script that runs mariadb in a chroot, its a qemu-arm-static rasoberrypi chroot but I don't that that should change much. The script installs and then sets the password for mariadb root user, ...
GuySoft's user avatar
  • 435

1
2 3 4 5
9