L
L
lolowin322017-09-13 14:54:14
Samba
lolowin32, 2017-09-13 14:54:14

How to set permissions on a file in linux when creating it?

Good afternoon everyone, help in solving the problem, I have a samba share on ubuntu server 16.04, and differentiated access to folders (everyone sees only what he is allowed), the user creates files in a certain folder that must be edited by another user, after adding the second user in the group of the first and setting the rights to the file, the second user can edit, but how to create files for the first user so that each time you do not have to change the rights to the file, and the files are already created with certain permissions?
All users for the fileshare were created with the /bin/false option, so probably editing umask 0002 in the .profile file in the users home directory won't help
Thanks in advance for your replies

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xp3, 2017-09-13
@lolowin32

I don't remember if it works on balls, but try to assign acl to the directory. You can give each user both default and temporary rights, do not include them in groups. Example :
setfacl -d -m "u:username:rw-" /share

A
athacker, 2017-09-13
@athacker

umask can be set in the settings for the balls. More precisely, there parameters like file permission and directory permissions -- regulate the default rights when creating files / directories.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question