2022 Developer Survey is open! Take survey.

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
17 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 ...
user avatar
0 votes
0 answers
23 views

debian phpfmp chroot and imagemagick - NoDecodeDelegateForThisImageFormat / supported formats:0

Friends, I've setup a chroot-jail with nginx and phpfpm 7.4 from packages.sury.org/php as usual (on Debian 5.10.103-1 bullseye). Imagemagick fails: <?php $im=new Imagick(__DIR__ . '/image.png'); ...
user avatar
  • 1
0 votes
0 answers
27 views

Centos 7 - SCP or FTP for specific user to specific folder

I've found tons of entries for this topic - but I've still not managed to get the following running: I like to provide a new user for accessing a specific already existing folder, whose owner must not ...
user avatar
  • 23
0 votes
0 answers
30 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 ...
user avatar
0 votes
0 answers
19 views

PHP-FPM chroot working out of the box, is it normal?

I'm trying, in a dev box (Ubuntu 20.04), to setup for the first time a chroot. Here is my PHP-FPM pool (Apache 2.4 as Webserver): [test] prefix = /srv/users/$pool user = $pool group = $pool listen ...
user avatar
0 votes
0 answers
52 views

Why I can't change qcow2 password via chroot

I have a Linux qcow2 image, and I want to change the root password. I combined qemu-nbd and chroot commands to access the filesystem in this qcow2 file. qemu-nbd --connect=/dev/nbd0 ./linux.qcow2 sudo ...
user avatar
0 votes
0 answers
21 views

Authentication with pub/priv key pair fails for chrooted users

I'm trying to isolate certain users from other users, which requires the use of either virtualization or jailing. At the moment I've gone with jailing, which mostly works fine, except for a single ...
user avatar
  • 21
0 votes
1 answer
59 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 ...
user avatar
  • 101
1 vote
2 answers
135 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 ...
user avatar
  • 133
0 votes
0 answers
49 views

Double check if an SSH account is SFTP-only and chrooted

Note that this question is not about how to do chroot or make an account SFTP only. The question is about whether there are specific ways for a sysadmin to check if a chrooted and SFTP-only account is ...
user avatar
0 votes
1 answer
39 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 ...
user avatar
0 votes
0 answers
248 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'...
user avatar
0 votes
1 answer
113 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 ...
user avatar
1 vote
1 answer
138 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 ...
user avatar
  • 263
0 votes
1 answer
153 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 "...
user avatar
0 votes
1 answer
204 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 ...
user avatar
  • 101
1 vote
0 answers
148 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/...
user avatar
0 votes
1 answer
273 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 ...
user avatar
1 vote
2 answers
2k 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 ...
user avatar
1 vote
1 answer
198 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 \ --...
user avatar
0 votes
1 answer
68 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 ...
user avatar
0 votes
1 answer
961 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 ...
user avatar
  • 1,139
0 votes
1 answer
1k 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 ...
user avatar
1 vote
0 answers
38 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 ...
user avatar
0 votes
1 answer
54 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 ...
user avatar
  • 1
1 vote
1 answer
1k 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 ...
user avatar
  • 144
0 votes
1 answer
663 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/...
user avatar
  • 1
1 vote
1 answer
231 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 ...
user avatar
  • 265
0 votes
0 answers
19 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 ...
user avatar
  • 193
2 votes
0 answers
233 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 ...
user avatar
  • 151
1 vote
0 answers
57 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 ...
user avatar
0 votes
0 answers
919 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 ...
user avatar
  • 405
0 votes
1 answer
384 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: ...
user avatar
1 vote
1 answer
2k 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 ...
user avatar
0 votes
0 answers
199 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 ...
user avatar
  • 253
2 votes
1 answer
296 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 ...
user avatar
0 votes
1 answer
1k 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 ...
user avatar
1 vote
0 answers
210 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 ...
user avatar
0 votes
1 answer
755 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 ...
user avatar
  • 1
1 vote
2 answers
766 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? ...
user avatar
2 votes
0 answers
1k 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 ...
user avatar
  • 165
0 votes
0 answers
302 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:/...
user avatar
1 vote
1 answer
182 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 ...
user avatar
0 votes
2 answers
898 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 ...
user avatar
  • 498
3 votes
1 answer
4k 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 ...
user avatar
  • 846
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 ...
user avatar
2 votes
0 answers
156 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 ...
user avatar
  • 21
0 votes
1 answer
193 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 ...
user avatar
0 votes
1 answer
943 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 ...
user avatar
  • 776
0 votes
1 answer
922 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, ...
user avatar
  • 405

1
2 3 4 5
9