Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16
I want to give root privilege to the command rm for only a directory Dir inside /local/home. How I can do that?...
  1. #1
    Linux Newbie imranka's Avatar
    Join Date
    Dec 2007
    Location
    Kolkata
    Posts
    177

    Giving rm root privilege for a particular directory

    I want to give root privilege to the command rm for only a directory Dir inside /local/home. How I can do that?
    Imran
    Linux User #467555 | Debian Squeeze | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | Gigabyte GA-G41MT-ES2L
    | 2 GB RAM | 320 GB SATA | Kernel: 2.6.32-5-686

  2. #2
    Just Joined! TheBoogyMaster's Avatar
    Join Date
    Apr 2009
    Posts
    45
    Linux permissions

    and why do you want to do that ?

  3. #3
    Linux Newbie imranka's Avatar
    Join Date
    Dec 2007
    Location
    Kolkata
    Posts
    177
    To prevent anybody from deleting anything from that folder. Only root should have the ability to do that.

    I'm sorry, but the link you've given doesn't help me BTW.
    Imran
    Linux User #467555 | Debian Squeeze | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | Gigabyte GA-G41MT-ES2L
    | 2 GB RAM | 320 GB SATA | Kernel: 2.6.32-5-686

  4. #4
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    I suppose that you want to make a directory undeleteable . Why not simply change the permission on that so that only the one who created that particular directory can only delete it.
    Code:
    chmod o+rwx directory/
    this will only grant the owner of the directory to have complete control on the directory. Hope this helps you.
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  5. #5
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    as long as the owner of the directory is root, all you need is to make sure that only owner has write access, above command would set that to be true, to make sure root owns it, just run
    Code:
    chown -R root:root /local/home

  6. #6
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    I have a doubt , If the directory is owned by root then normal user will not have acces to it unless granted by the root.
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  7. #7
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    if you use
    Code:
    chmod -R 744 /local/home
    it will be readable by anyone, but only writeable by root

  8. #8
    Linux Newbie imranka's Avatar
    Join Date
    Dec 2007
    Location
    Kolkata
    Posts
    177
    No here's the catch.

    If i give rwx to only root, then a normal user can't even move a file from or to that directory, that I don't want to restrict. I just want to restrict the deletion of file, that's all.
    Imran
    Linux User #467555 | Debian Squeeze | Intel(R) Core(TM)2 Duo CPU 4500 @ 2.20GHz | Gigabyte GA-G41MT-ES2L
    | 2 GB RAM | 320 GB SATA | Kernel: 2.6.32-5-686

  9. #9
    Linux User vickey_20's Avatar
    Join Date
    Mar 2009
    Location
    Mumbai, India
    Posts
    493
    then try this
    chmod a+rx directory
    this will give every one a read and entering permission.
    Only if I could understand the man pages
    Registered Linux user #492640
    OS: RHEL4,5 ,RH 9,Ubuntu

  10. #10
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    I'm not sure what you desire is possible without it being a samba share. You can't specify that a directory can only have something created and not deleted. I don't get what difference is between deleting a file and moving a file from the directory, they are the same, except moving has a destination. If it was a samba share, you could specify that the directory was world writeable, and all files created in it could have a specific mask that would not allow them to be modified or deleted once added, this is about as close as you can get to what you want I believe.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...