The Linux Community Forum

The Forums => General Discussion => Topic started by: jay on October 19, 2019, 05:05:19 am

Title: Folder permission
Post by: jay on October 19, 2019, 05:05:19 am
Hi,
Newbie hear!.

can any one please let me know if it is possible to have create folder permission without write permission to a parent directory in linux?

~Jay
Title: Re: Folder permission
Post by: Mark Greaves (PCNetSpec) on October 19, 2019, 05:18:04 pm
Not 100% sure what you're asking...

If you're asking if it's possible to have a directory WITHOUT write permissions (by a particular users/groups), but have a subdirectory WITH write permissions .. yes.

Try it
Code: [Select]
mkdir ~/test-parent
mkdir ~/test-parent/test-child
chmod 555 ~/test-parent
Now see if you can create a file or folder in ~/test-parent and ~/test-parent/test-child

Or am I misunderstanding the question ?



You can delete these test folders (and contents) when you're done testing with:
Code: [Select]
sudo rm -r ~/test-parent
Title: Re: Folder permission
Post by: jay on October 19, 2019, 05:44:48 pm
Thanks Mark. Below is what i was trying to see if it is possible.

Parent folder: ~/test-parent

I don't want anyone to write to the parent folder, but they can create subfolders and write to those subfolders under test-parent. Please let me know if it is possible in anyways.

~Jay
Title: Re: Folder permission
Post by: Mark Greaves (PCNetSpec) on October 20, 2019, 01:19:32 am
Well I can't see how they could CREATE subdirectories if they're not allowed to write to the parent directory .. because creating directories requires write permission.
Title: Re: Folder permission
Post by: jay on November 02, 2019, 06:23:28 pm
Thanks Mark. In other words, can only mkdir command is allowed to execute in Parent folder:(~/test-parent) and restrict all other commands just for parent folder?
Title: Re: Folder permission
Post by: Mark Greaves (PCNetSpec) on November 03, 2019, 09:13:04 am
Sorry I'm having difficulty understanding what you''re asking.
Title: Re: Folder permission
Post by: jay on November 11, 2019, 09:25:27 pm
Mark,

Below is what I want to check.

Parent folder: ~/test-parent (allow only mkdir command in this folder)
child folder:         |_ child-folder-under-parent (allow write and other commands in this folder)

Please let me know if the above setup is possible.

~Jay
Title: Re: Folder permission
Post by: Mark Greaves (PCNetSpec) on November 12, 2019, 01:44:42 am
No, you could only use mkdir in the parent folder if you had elevated privileges (sudo mkdir).

There's no way (that I know of) to allow writing of folders but not files .. you either have write permission or you don't.
SimplePortal 2.3.3 © 2008-2010, SimplePortal