[Bug 4046] New: ChrootDirectory %h make sftp read-only

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Thu Oct 29 09:50:38 AEDT 2026


https://bugzilla.mindrot.org/show_bug.cgi?id=4046

            Bug ID: 4046
           Summary: ChrootDirectory %h make sftp read-only
           Product: Portable OpenSSH
           Version: 10.2p1
          Hardware: amd64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P5
         Component: sftp-server
          Assignee: unassigned-bugs at mindrot.org
          Reporter: mgregorelli at proton.me

the client uses OpenSSH_10.6p1
while the serve uses OpenSSH_10.2p1

**setup**
user : uuser:x:1000:1002::/home/uuser:/usr/sbin/nologin

relevant /etc/ssh/sshd_config:
Match User uuser
        ChrootDirectory %h
        ForceCommand internal-sftp  
        AllowTcpForwarding no  
        X11Forwarding no

ls -la /home/uuser
drwxr-xr-x.  5 root  root  58 Oct 10 23:30 ./
drwxr-xr-x.  4 root  root  31 Oct 10 23:30 ../
drwx------. 12 uuser root 144 Oct 10 23:30 personal/
drwxr-xr-x.  2 root  root  29 Oct 10 23:30 .ssh/

when i access via `sftp -P 2222 uuser at server-ip` I'm able to login
correctly and i can access (read) everything 'uuser' should be allowed
to access.
The problem is that when i try to alter something (e.g. create a new
folder inside 'personal') the server returns 'Permission denied'
I have found out that if i comment out the ChrootDirectory setting or
make it point to '/' then everything works as expected, this bother me
a bit because i don't want ftp users to have any access outside their
directory and this is a strange behaviour and looks like a bug.

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list