N
N
nikitakarpenko2019-01-28 11:54:16
System administration
nikitakarpenko, 2019-01-28 11:54:16

How are permissions set for a file or folder when it is created?

The problem from which the question arose:
(Local project) I generate a file in a folder that is publicly accessible. As a result, it is generated and I can download it.
It is generated on the server, but it is impossible to download.
The essence of the question:
if the user who runs the php script in bash (which generates the file) is not the owner, but only in the group of users with rights (644), for example, then accordingly he cannot create a file / folder with the highest level of rights, is that right?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2019-01-28
@Tabletko

man umask

P
pfg21, 2019-01-28
@pfg21

php runs either under the user of the web server or under the user of the php interpreter, for example php-fm as a separate process from the web server.
run id them-under puff, and see what user is being used and go under it for example.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question