I have a user which I have called username in the below code, in the sshd config file there is this:
Match user username
ChrootDirectory /media/pi/128db83f-859d-48dc-a784-4337c53c736f/username
Match group sftponly
ChrootDirectory /media/pi/128db83f-859d-48dc-a784-4337c53c736f/%u
X11Forwarding no
AllowTcpForwarding no
ForceCommand internal-sftp
The user is in the group sftponly. I know that the first ChrootDirectory should take effect and the 2nd one ignored for this user.
Within that directory there is a directory called upload, when I log in as this user at a SFTP client and list the files in upload it lists no files, and doesn't give an error, it says success.
But there are files there, the upload directory has 774 for its permissions. Read access for public/other users (which username is) is enabled. The individual files themselves have read access for public/other users.
Why can't username see these files?