Results 1 to 10 of 10

Thread: chmod for folder

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    125

    Question chmod for folder

    hi, Experts.

    I am facing a difficulty in samba sharing permission setting.. i wish to allow all permission to all nobody user, but not to allow the add and delete feature in my shared folder.

    For example:

    In my shared folder A, it has file A.
    The user can edit and save the file A, but the user not allowed to delete the file A and also not allowed to add any files/folders in folder A.

    What is the chmod command should i use to apply for folder A to meet the requirement above?

    Thanks
    Jack
    Last edited by jackeng1983; Sep 9th, 2010 at 10:40 AM.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    125

    Re: chmod for folder

    Hi,

    Is any experts can help?

  3. #3
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: chmod for folder

    Can you explain better? Spell out exactly what it is you wish to do.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    125

    Re: chmod for folder

    i did edited my thread, hope you can understand me.. sorry for my poor English.
    Last edited by jackeng1983; Sep 9th, 2010 at 10:51 AM.

  5. #5
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: chmod for folder

    Never used it myself, perhaps this can help:
    http://catcode.com/teachmod/
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    125

    Re: chmod for folder

    Quote Originally Posted by MarMan View Post
    Never used it myself, perhaps this can help:
    http://catcode.com/teachmod/
    Yes, i tried to view this before.. There is only guide for read,write and execute permission, no add or delete permission guide.

  7. #7
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: chmod for folder

    Read, write, and execute are the only priveleges you can assign. They have different meanings for files and for directories.

    Have a look at the table on this page:
    http://webmasterworkshop.com/guides/chmod_guide.shtml
    and the Wikipedia article:
    http://en.wikipedia.org/wiki/Chmod

    In your case, you could use:
    chmod -R a=rw dirA
    chmod a-w+x dirA


    The first command assigns read and write permissions for all groups for dirA and all directories and folders beneath it.
    The second modifies the permissions for dirA itself by removing the write permission (so that one cannot add or remove files) and adding execute (so that one can list the directory contents).

    The problem with this approach is that only the root user will be able to modify the directory tree.
    Depending on how your Samba server is set up, you could perhaps use chown to set the owner/group of the directory and assign permissions differently for user/group/owner.
    Last edited by penagate; Sep 15th, 2010 at 11:46 PM.

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    125

    Re: chmod for folder

    Quote Originally Posted by penagate View Post
    Read, write, and execute are the only priveleges you can assign. They have different meanings for files and for directories.

    Have a look at the table on this page:
    http://webmasterworkshop.com/guides/chmod_guide.shtml
    and the Wikipedia article:
    http://en.wikipedia.org/wiki/Chmod

    In your case, you could use:
    chmod -R a=rw dirA
    chmod a-w+x dirA


    The first command assigns read and write permissions for all groups for dirA and all directories and folders beneath it.
    The second modifies the permissions for dirA itself by removing the write permission (so that one cannot add or remove files) and adding execute (so that one can list the directory contents).

    The problem with this approach is that only the root user will be able to modify the directory tree.
    Depending on how your Samba server is set up, you could perhaps use chown to set the owner/group of the directory and assign permissions differently for user/group/owner.
    chmod a-w+x dirA
    yes, this make the users cannot add or remove files in this dirA folder, this work great... how about i want to able edit the file? (currently the file able for read only).

  9. #9
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: chmod for folder

    You need write permissions on the files. That's what the first command I gave you does. You need to run both, in order.

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Dec 2006
    Posts
    125

    Re: chmod for folder

    i already tried, the file become read only after executed the both command that u gave.

Posting Permissions

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



Click Here to Expand Forum to Full Width