A chroot on Unix operating systems is an operation that changes the apparent root directory for the current running process and its children.
Questions tagged [chroot]
413 questions
0
votes
1 answer
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
AllowTcpForwarding no
ForceCommand internal-sftp
Using…

azraelAT
- 103
- 1
0
votes
0 answers
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 but it doesn't log commands for users in…
0
votes
1 answer
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 other processes on the system
(especially those…

polettix
- 101
- 1
0
votes
1 answer
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 load, and if the file is not available in the…

cestmoi
- 1
0
votes
1 answer
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't see neither directories' names no can't browse…

FlipFlap
- 1
- 1
- 2
0
votes
1 answer
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 that is allowed
must not be allowed to…

Ondřej Holík
- 11
- 2
0
votes
1 answer
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 "Exit status 4" which I see is "Connecting to host…

TommyPeanuts
- 472
- 1
- 7
- 24
0
votes
1 answer
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 bind 0 0
When I do df -h I get the…

RafaelKr
- 101
- 4
0
votes
1 answer
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 cant connect.
I want it to be writable while the…
0
votes
1 answer
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 connected user to read the contents of the .ssh folder…

Robert Navado
- 101
- 1
0
votes
1 answer
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 sure to use the absolute path to the binary. No…

mhost
- 1,179
- 3
- 16
- 25
0
votes
1 answer
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 problem, if they want to upload files they can…

Eliezer Miron
- 113
- 1
- 5
0
votes
1 answer
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 directories.
/var/www/hosts <- admin chroot …

iGuy
- 1
0
votes
1 answer
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/html/wordpress1 and /var/www/html/wordpress2, I…

KNCK
- 1
- 2
0
votes
1 answer
Chroot with CentOS 5.3 + openssh 4.3p2
OS: CentOS 5.3, with openssh 4.3p2
Trying to set 'chroot' in ssh shell, but openssh version prior to 4.8 doesn't take below settings. yum update openssh open up to version 4.3 which is quite old. Doesn't CentOS support openssh 4.8 or up? If that's…

Scud
- 113
- 1
- 4