Parent permission

Hi.
I have folder /share with permission nobody:nogroup (for samba). When I copy files/folders as root then permission changes. How make automatical set permission that parent folder ?
 
Don't copy the files as root. Root will override any permissions.
 
But if I download torrent via transmission started as user transmission then permission set transmission:transmussio for example.
Need inheritance all permission as parent folder.
 
manefesto said:
But if I download torrent via transmission started as user transmission then permission set transmission:transmussio for example.
Again, root overrides all permissions. A normal user doesn't.
Need inheritance all permission as parrent folder.
Then copy the files as a normal user, not root.
 
manefesto said:
Hi.
I have folder /share with permission nobody:nogroup (for samba). When I copy files/folders as root then permission changes. How make automatically set permission that parent folder ?

Set the 4000 or 2000 bit, aka setuid or setgid, on the parent directory. Then, any files created in that directory will pick up the user or group from the parent.

Code:
$ mkdir test
$ chown nobody:nogroup test
$ chmod u+s,g+s test

You will also need to add w permission to either the group or the "other" set, in order for non-root user to write to the directory.
 
leksey said:
Code:
chmod u+s

Is Does that makes sense? For a directory, it is ignored.
First keep in mind that you're responding to a thread that is nearly three years old. Don't take my comment the wrong way, the only reason I mention it is because I can fully understand the confusion, I sometimes have issues with that stuff too these days.

Now; whether this is or isn't ignored depends on your kernel. FreeBSD uses the GENERIC kernel by default which tends to ignore this setting. But if you add the SUIDDIR option to the kernel configuration and then build your own kernel this will become a valid option.

Should you want to know more about building a custom kernel then you should start checking out chapter 9.5 of the handbook.
 
Back
Top