Author Topic: Folder permission  (Read 2534 times)

0 Members and 1 Guest are viewing this topic.

Offline jay

  • Jr. Member
  • **
  • Posts: 4
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
Folder permission
« 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

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18257
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Folder permission
« Reply #1 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
« Last Edit: October 19, 2019, 05:26:29 pm by Mark Greaves (PCNetSpec) »
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline jay

  • Jr. Member
  • **
  • Posts: 4
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
Re: Folder permission
« Reply #2 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

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18257
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Folder permission
« Reply #3 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.
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline jay

  • Jr. Member
  • **
  • Posts: 4
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
Re: Folder permission
« Reply #4 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?

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18257
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Folder permission
« Reply #5 on: November 03, 2019, 09:13:04 am »
Sorry I'm having difficulty understanding what you''re asking.
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

Offline jay

  • Jr. Member
  • **
  • Posts: 4
  • Karma: 0
  • I've just joined!
    • View Profile
    • Awards
Re: Folder permission
« Reply #6 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

Offline Mark Greaves (PCNetSpec)

  • Administrator
  • Hero Member
  • *****
  • Posts: 18257
  • Karma: 476
  • Gender: Male
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
    • Awards
Re: Folder permission
« Reply #7 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.
WARNING: You are logged into reality as 'root'
logging in as 'insane' is the only safe option.
pcnetspec.co.uk

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal