i'm trying to force newly created files and directories to be owned by nginx user and to set the right permissions so nginx group users can execute and modify them if needed.

The whole thing is i've just configured vsftpd service where my virtual users act as vsftpd user, where vsftpd is a real user with no shell.

After login, each user is chrooted on a directory owned by user vsftpd and group nginx. To accomplish that i created the chroot directory:

Code:

mkdir chroot/

and then gave the default permissions:

Code:

chown -R vsftpd:nginx chroot/

and then enabled SGUID:

Code:

chmod -R g+s chroot/

Right here, when a vsftpd user creates a directory default permissions are vsftpd:nginx but default permissions for files are nginx:nginx which is not what i want.

Then, as i need nginx user's group to run and modify files if need i setted umask '0022' through vsftpd config but i think i'm going in the wrong way. Can anyone point me to the right direction?_________________Si el tonto te alaba lamentalo, si el listo te censura piensalo...