Hello I new to linux and i have searched about 10 hours for a answer without success.

I have created a folder called "Datatank" and chmod 777 Datatank

All files and folder inside Datatank can I delete.

But if nobody user creates a folder inside Datatank, i can delete that folder. But if nobody user creates a folder a put files inside it i cant delete the files, only the whole folder.

Is is posible to give the parrent directory owner full access to all sub directories and files ?

I want all subfolders and files to inhert the permission from the parrent folder. So whoever can create a folder and i can delete files and folders inside it.

  • You can't change the owner of a file unless you are the superuser. But there may be another way to do what you want. What exactly is your end goal? You say you want "full access", but is it just that you want to be able to remove the subfiles? Remove the subdirectory? Move the subdirectory out of Datatank?
    – dg99
    Sep 6, 2013 at 13:14
  • I want to be able to delete files inside subdirs. I can only delete files/folders inside the parrent dir right now. I got a drive everyone can use, but if someone create a folder and put stuff inside it i cant delete the stuff. only the whole folder. cause i only got access to delete folders and files inside the parrent not inside the folder created by the other users wich is nobody
    – CasperC
    Sep 6, 2013 at 13:22
  • Then @JustinSane's answer is exactly what you need. If you force everything inside Datatank to inherit your group and group permissions, you'll be able to delete whatever you want, even if the item is owned by another user.
    – dg99
    Sep 6, 2013 at 16:54

1 Answer 1


You can set the setgid-flag on the group permission of a directory like this:

chmod g+s folder

This makes every newly created file in that folder inherit the owning group and group permissions of the parent folder. See https://en.wikipedia.org/wiki/Setuid

  • Hmm,, but then the "guests" also inhert my permissions and can delete my stuff ?
    – CasperC
    Sep 6, 2013 at 18:25
  • Only if they are members of the owning group. Most likely, that is your personal group with the same name as your username, so if they have their write permission to your folder by the "other" permissions, and you do ´chmod o-w´ on your own files, they can't delete them. Sep 6, 2013 at 18:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .