V
V
Vincent12018-05-16 21:52:11
Access rights
Vincent1, 2018-05-16 21:52:11

How to set the necessary permissions on new files in UNIX?

I want all newly created folders in /home/user to have rwx --x --x permissions
and new files to rwx r-- r--
How can I do that?
I tried to use `setfacl` in different combinations, but it did not work out as it should.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
egor_nullptr, 2018-05-16
@egor_nullptr

Add umask 0022to your .bashrc (or other similar file).

S
Saboteur, 2018-05-17
@saboteur_kiev

What you need is the umask.
But it does not work the way you want, that is, it will not work to set such different rights for folders and files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question