Results 1 to 10 of 10

Thread: Shared folder

  1. #1

    Default Shared folder

    I am trying to make a shared folder that every user on a single computer can use, at the moment everyone can access the folder but they cannot save an edited file. i couldn't find a built in shared folder, however being new to linux i may not have looked in the right place.

  2. #2
    Join Date
    Jul 2010
    Location
    Adelaide, Australia
    Posts
    963

    Default Re: Shared folder

    Change the permissions of the folder like so:
    Code:
    chmod -R 777 /path/to/folder
    Replace /path/to/folder with the path of the folder. Then everyone should be able to use it.
    Desktop: Gigabyte GA-Z270-HD3 - Core i7 7700K - openSUSE Leap 42.2 KDE
    Laptop: HP EliteBook 8770W - Core i7 3940XM - openSUSE Leap 42.2 KDE

  3. #3

    Default Re: Shared folder

    Hi, thanks for the response, however that still only changes the permissions of the folder. Any new files created in this folder still cannot be edited by other users. the file permissions of the folder are 'drwxrwxrwx'. I need the shared folder to resemble windows public folder, where anyone who is logged in can access and change documents in the folder.

  4. #4
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Shared folder

    You need ACLs for this due to the inheritance required. First of all the filesystem must be mounted with the acl,user_xattr options before proceeding.

    Next you put all the users you want to grant access in a particular group. The group users is already predefined in openSUSE, but you can also create a secondary group, e.g. in /etc/group you have:

    Code:
    editors:!:1000:alice,bob,carol
    You can use YaST to create this entry, you don't have to use the CLI.

    The next step uses the CLI, maybe it can be done in YaST, I haven't looked.

    Code:
    mkdir /some/shared/directory
    setfacl -d -m g:editors:rwx /some/shared/directory
    This sets the default ACL on that directory.

    Code:
    getfacl /some/shared/directory
    will show that the editors group has rwx permission. Now you can create a file there.

    Code:
    touch /some/shared/directory/file
    getfacl /some/shared/directory/file
    will show that the file has rw permission for everybody in the editors group.

    PS: Mode 777 is bad advice. It's hardly ever needed.

  5. #5

    Default Re: Shared folder

    OK i tried this, it says
    getfacl: Removing leading '/' from absolute path names
    # file: home/shared
    # owner: root
    # group: root
    user::rwx
    group::r-x# group: root
    other::r-x
    default:user::rwx
    default:group::r-x
    default:group:Staff:rwx
    default:mask::rwx
    default: other::r-x

    other users cannot open or save to the folder at all now, i'm thinking it has something to do with "# group: root".

    any more help you can give would be appreciated.

    Edit: added a space the last default line because it kept becoming a smilie

  6. #6
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Shared folder

    The line that matters is staff. Are your users in this group? If you have just added them to this group, they need to logout and login again; groups are instantiated per session. The command

    groups

    will show what groups their current session is in. Also group names should normally be lowercase.

  7. #7

    Default Re: Shared folder

    The groups were made a few weeks ago, and i haven't changed them since. i just tried with a different account, other accounts can now edit and save a file in this folder but cannot save a new file there. i'm begining to wonder why a shared folder hasn't been included by defualt.

  8. #8
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: Shared folder

    I think I forgot to mention to do this:

    Code:
    chgrp editors /some/shared/directory
    chmod g+w /some/shared/directory

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Shared folder

    On 2010-11-03 14:41, Damo990 wrote:
    >
    > Hi, thanks for the response, however that still only changes the
    > permissions of the folder. Any new files created in this folder still
    > cannot be edited by other users. the file permissions of the folder are
    > 'drwxrwxrwx'.


    You need to make this directory group SUID. Then all files created will
    inherit the group settings.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.2 x86_64 "Emerald" at Telcontar)

  10. #10
    Join Date
    Aug 2009
    Location
    Buenos Aires, Argentina
    Posts
    95

    Default Re: Shared folder

    This post was really useful to me.

    I did

    Code:
    # chmod g+s
    # setfacl -d -m g:my_group:rwx /some/shared/directory
    and all the new files belong to the group and inherits the group permissions.

    Thanks a lot,

    Pancho
    openSUSE | Think correctly

Posting Permissions

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