Results 1 to 3 of 3

Thread: Share folder among two users of same PC.

  1. #1
    Join Date
    Jun 2012
    Beans
    3

    Question Share folder among two users of same PC.

    Hello Folks,

    How to share a folder to all the users in Ubuntu, Can I create some folder outside "home" folder and access it by all users ?

  2. #2
    Join Date
    Oct 2005
    Location
    Al Ain
    Beans
    7,808

    Re: Share folder among two users of same PC.

    Make a directory and change the group to something that all users are members of such as 'users' and make it 'setuid' and 'setgid' (+s), so that all new files will aquire that user and group setting.
    Last edited by HermanAB; June 6th, 2012 at 01:01 PM.

  3. #3
    Join Date
    Dec 2009
    Beans
    5,304

    Re: Share folder among two users of same PC.

    [1] Create a folder such as /home/Common
    Code:
    sudo mkdir /home/Common
    [2] Change permissions. This depends on what you mean by "shared":
    This will allow all users to add to and delete any file but only be able to read and not write to someone else's files:
    Code:
    sudo chmod 0777 /home/Common
    This will do the same thing as above but only the owner of the file can delete the file ( the "1" is a "sticky bit" ):
    Code:
    sudo chmod 1777 /home/Common
    If you want the ability to actually write to another users files then things get more involved:
    ** Change the group of the folder to say for example, plugdev:
    Code:
    sudo chown :plugdev /home/Common
    ** If your users are not members of the plugdev group they will need to be added:
    Code:
    sudo gpasswd -a morbius plugdev
    ** Then you need to change the default umask so that files are added as 664 and not 644:

    NOTE: The default umask is already at 002 if you are running 12.04 so this step is not required.
    Edit /etc/profile as root:
    Code:
    gksu gedit /etc/profile
    Find the line at the bottom that references umask and change it to:
    Code:
    umask 002
    ** Then change permissions of the shared folder:
    Code:
    sudo chmod 2775 /home/Common
    OR
    Code:
    sudo chmod 3775 /home/Common
    "2775" - All plugdev users will be able to add and delete all files and will have read/write access to all new files. The "2" is a setgid bit.
    "3775" - All plugdev users will be able to add to but delete only their own files and have read/write acces to all new files. The "3" is a "sticky" (1) + "setgid" (2) =3.
    Last edited by Morbius1; June 6th, 2012 at 02:04 PM.

Tags for this Thread

Bookmarks

Posting Permissions

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