M
M
Mikhail2020-01-23 13:19:24
linux
Mikhail, 2020-01-23 13:19:24

How to set permissions on new files and folders in linux for nginx?

Good afternoon everyone.
There is a problem, I have a directory in which users upload files via ftp. All new files for nginx are not available
/home/dima/www/ I
use the commands:
groupadd developer
usermod -G developer diman_ftp
chown diman_ftp:developer /home/diman_ftp/www
Also set:
chown -R www-data:developer /home/diman_ftp/ www
But still, when adding data by the user, nginx writes 403

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri Samoilov, 2020-01-23
@mix_gorbachev

You need to configure ftp, for vsftpd add something like this to the config:

chmod_enable=YES  
file_open_mode=0644
local_umask=022

G
Germanjon, 2020-01-23
@Germanjon

/home/dima/www/
/home/diman_ftp/www

The folders are different - is it by chance or so planned?
What user is running nginx? What are the permissions and owners of the /home, /home/diman_ftp and /home/diman_ftp/www folders

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question