Results 1 to 8 of 8

Thread: Others users can't browse my private home folder

  1. #1
    Join Date
    May 2010
    Beans
    5

    Others users can't browse my private home folder

    Hi,
    I used the command
    sudo chmod 0750 /home/Gianni
    to make my home folder private.

    Now, I would like that another user in my pc can read files in a subdirectory of my home. I was running several commands with chmod and chown and I tried with Nautilus too, but without success.

    I just would like to place a link on the second user's desktop, that he can click on and access my subdirectory.

    Thanks!

  2. #2
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: Others users can't browse my private home folder

    Welcome to the forums.

    lI saved this as it seemed useful and my be what you really want. It discusses a music folder but it could be any or several other folders.

    Two users to share music folder - group & permissions -BoneKracker:
    http://ubuntuforums.org/showthread.php?t=1484221
    The 2 at the beginning makes the directory SGID (Set Group ID). That means any files in the directory automatically will inherit the group of the folder, as opposed to the group of the user putting the file there.

    mv ~/music /home
    chown root:music /home/music
    chmod 2774 /home/music or 3774

    would not recommend using the /media folder.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #3
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Others users can't browse my private home folder

    Quote Originally Posted by Elris View Post
    Hi,
    I used the command
    sudo chmod 0750 /home/Gianni
    to make my home folder private.

    Now, I would like that another user in my pc can read files in a subdirectory of my home. I was running several commands with chmod and chown and I tried with Nautilus too, but without success.

    I just would like to place a link on the second user's desktop, that he can click on and access my subdirectory.

    Thanks!
    Add the user to your user's primary group. By default, your user's primary group name is the same as your login name.

    i.e.:
    Code:
    sudo gpasswd -a user Gianni

  4. #4
    Join Date
    May 2010
    Beans
    5

    Re: Others users can't browse my private home folder

    Quote Originally Posted by oldfred View Post
    Welcome to the forums.

    lI saved this as it seemed useful and my be what you really want. It discusses a music folder but it could be any or several other folders.

    Two users to share music folder - group & permissions -BoneKracker:
    http://ubuntuforums.org/showthread.php?t=1484221
    The 2 at the beginning makes the directory SGID (Set Group ID). That means any files in the directory automatically will inherit the group of the folder, as opposed to the group of the user putting the file there.

    mv ~/music /home
    chown root:music /home/music
    chmod 2774 /home/music or 3774

    would not recommend using the /media folder.
    Unfortunately my folder is a subdirectory of my home folder.
    So, /home/my_user/subfolder

    So, I can't place it directly in /home

    The problem is that when I have a subdirectory of my home folder I can't let others reach it despire waht permissions I give it.

  5. #5
    Join Date
    May 2010
    Beans
    5

    Re: Others users can't browse my private home folder

    Quote Originally Posted by sisco311 View Post
    Add the user to your user's primary group. By default, your user's primary group name is the same as your login name.

    i.e.:
    Code:
    sudo gpasswd -a user Gianni
    But in the case it seems to me that the second user can read all my files. Instead, I want that he can read just files in a specific folder.

  6. #6
    Join Date
    May 2010
    Beans
    5

    Re: Others users can't browse my private home folder

    The reason why I can't have my shared folder in /home but I need it in my user's folder is because it is a subdirectory of Dropbox folder.

    So, I need something like this:

    /home/gianni/dropbox/sharedfolder

    and I need the second user to access it.

    Thanks a lot

  7. #7
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: Others users can't browse my private home folder

    Quote Originally Posted by Elris View Post
    The reason why I can't have my shared folder in /home but I need it in my user's folder is because it is a subdirectory of Dropbox folder.

    So, I need something like this:

    /home/gianni/dropbox/sharedfolder

    and I need the second user to access it.

    Thanks a lot
    Sorry for the delay.

    You have to create the shared directory outside of your home. It must be owned by you and you have to set read permissions for a group and add the second user to this group. You also have to set the setgid permission on the directory, in this way new files created in the shared directory will inherit its groupid.

    1. Create a directory in /home:
      Code:
      sudo mkdir /home/.shared
    2. Set the owner:
      Code:
      sudo chown gianni /home/.shared
    3. Set the group you want to allow to read the directory (i.e. users):
      Code:
      sudo chgrp users /home/.shared
    4. Add the second user to the users group:
      Code:
      sudo gpasswd -a username users
    5. Set the permissions:
      Code:
      sudo chmod 2750 /home/.shared
    6. Copy/Move the files you want to share in /home/.shared.

    7. Create a symbolic link in the dropbox directory:
      Code:
      ln -s -T /home/.shared /home/gianni/dropbox/sharedfolder
    8. Create a symbolic link to the shared directory in the second user's home, as the second user run something like:
      Code:
      ln -s -T /home/.shared /home/username/whatever

  8. #8
    Join Date
    May 2010
    Beans
    5

    Re: Others users can't browse my private home folder

    Thanks. Great explanation. It worked perfectly!

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
  •