I have successfully setup jailed SFTP access using ChrootDirectory.
Match Group sftponly
ChrootDirectory %h
X11Forwarding no
AllowTCPForwarding no
ForceCommand internal-sftp
I also used: Subsystem sftp internal-sftp -u 0002 to ensure proper permissions are applied.
My issue now is when new files or folders are SFTPed to the server, or created using the SFTP client, they are assigned to the user and the group is the user instead of apache.
How can I make it so that my files will automatically be assigned to the apache group?