Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Recursive shared media folders (samba)

  1. #1
    Join Date
    Jan 2011
    Location
    British Columbia
    Beans
    Hidden!
    Distro
    Ubuntu Gnome 16.04 Xenial Xerus

    Recursive shared media folders (samba)

    I currently have samba set up to share to XBMC. One of my shares contains many folders. But the permissions aren't given to access those folder only the container folder.

    I can browse the folders recursively with a windows Laptop

    How do i enable recursive permissions?
    Last edited by XBMC old School; March 20th, 2011 at 07:34 PM.

  2. #2
    Join Date
    Dec 2007
    Location
    Middle of Nowhere
    Beans
    82
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Recursive shared media folders (samba)

    Recursive Permission Changes

    To change the permissions of multiple files and directories with one command. Please note the warning in the chmod with sudo section and the Warning with Recursive chmod section.

    Recursive chmod with -R and sudo

    To change all the permissions of each file and folder under a specified directory at once, use sudo chmod with -R
    user@host:/home/user$ sudo chmod 777 -R /path/to/someDirectory
    source is https://help.ubuntu.com/community/Fi...ission Changes
    All answers are all replies, but not all replies are answers.

    Linux is not Windows

  3. #3
    Join Date
    Dec 2009
    Beans
    6,530

    Re: Recursive shared media folders (samba)

    The only problem with a "chmod 777 -R" is that it doesn't discriminate between a file and a directory. A "7" will enable read, write, and execute.

    An "execute" on a directory means to open it up to see what's inside. That what you want it to do. An execute on a file means .. well ... to execute. That's not what you want - at least not for every file.

    On way around this is to use another method:
    Code:
    sudo chmod -R a+rwX /path/to/someDirectory
    The big "X" will cause all folders to have the execute bit "on" and all files that are not already marked executable to have the execute bit turned "off":
    Folders: 777
    Files: 666

    But you said this was a samba share. Can you access all folders locally? There may be a samba way around this.
    Last edited by Morbius1; March 20th, 2011 at 09:24 PM. Reason: forgot the sudo

  4. #4
    Join Date
    Jan 2011
    Location
    British Columbia
    Beans
    Hidden!
    Distro
    Ubuntu Gnome 16.04 Xenial Xerus

    Re: Recursive shared media folders (samba)

    Quote Originally Posted by Morbius1 View Post

    But you said this was a samba share. Can you access all folders locally? There may be a samba way around this.
    Um, ya i can access the folders via a windows laptop (wireless) no problem. But I have an XBMC (ATV) media centre (via bridge) that is having issues accessing the sub-folders.

    Side question, i want write ability for the windows laptop but i am blocked in ubuntu because i don't have ownership control. Is there a work-a-round to make all written files to be ownerless or full permissions?

    Thanks for your time and experience.

    Thanks Morbius
    Ubuntu-Gnome 17.04, 4.14 Kernel
    Core i7 c/w itx Board / Z87 Chipset
    R9 280OC (Tahiti Pro, Radeon HD 7950/4950 OEM)
    256gb OS, ~8TB of Spinners

  5. #5
    Join Date
    Dec 2009
    Beans
    6,530

    Re: Recursive shared media folders (samba)

    I'm getting confused by your description of the environment.

    I'm not even sure if the samba shares are on an Ubuntu box. If they are please post the output of the following commands so I can see how they are set up:
    Code:
    net usershare info --long
    Code:
    testparm -s
    All of this could be simple enough to fix depending on how you are set up. For example, If you have a guest share set up on an ubuntu box and the local login user on that ubuntu box ( let's call him bob ) has read / write access to the folder ( and it's contents ) that's being shared then you can make it so all remote users have the same access by adding a line to smb.conf:
    Code:
    force user = bob
    Whatever bob has access to so does the remote user. When a remote user adds something to the share the ownership will be converted to bob.

    Where to put that line in this example depends on what method of samba sharing you are using - there are two and the output of the two commands above will tell me that.

  6. #6
    Join Date
    Jan 2011
    Location
    British Columbia
    Beans
    Hidden!
    Distro
    Ubuntu Gnome 16.04 Xenial Xerus

    Re: Recursive shared media folders (samba)

    XXXXXXX@XXXXXXX:~$ net usershare info --long
    [xbmc movies (themoviedb)]
    path=/home/parent/Videos/xbmc/XBMC Movies (ThemovieDB)
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y

    info_fn: file /var/lib/samba/usershares/video is not a well formed usershare file.
    info_fn: Error was Path is not a directory.
    [share]
    path=/media/Family Shares/House Shares
    comment=
    usershare_acl=Everyone:F,
    guest_ok=n

    [xbmc]
    path=/home/parent/Videos/xbmc
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y

    [xbmc television]
    path=/home/parent/Videos/xbmc/XBMC Television
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y

    [xbmc movies (imdb)]
    path=/home/parent/Videos/xbmc/XBMC Movies (IMDB)
    comment=
    usershare_acl=Everyone:F,
    guest_ok=y

    XXXXXXX@XXXXXXX:~$ testparm -s
    Load smb config files from /etc/samba/smb.conf
    rlimit_max: rlimit_max (1024) below minimum Windows limit (16384)
    Processing section "[printers]"
    Processing section "[print$]"
    Processing section "[Share]"
    Processing section "[xbmc]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    [global]
    server string = %h server (Samba, Ubuntu)
    security = SHARE
    encrypt passwords = No
    map to guest = Bad User
    obey pam restrictions = Yes
    pam password change = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    unix password sync = Yes
    syslog = 0
    log file = /var/log/samba/log.%m
    max log size = 1000
    dns proxy = No
    usershare allow guests = Yes
    panic action = /usr/share/samba/panic-action %d

    [printers]
    comment = All Printers
    path = /var/spool/samba
    create mask = 0700
    printable = Yes
    browseable = No
    browsable = No

    [print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers

    [Share]
    path = /media/Family Shares/House Shares
    read only = No
    guest ok = Yes

    [xbmc]
    path = /home/parent/Videos/xbmc
    read only = No
    guest ok = Yes

    Here is the requested information. I have a desktop PC as per my signature, an XBMC media centre (Linux installed ATV) and a win7 laptop.

    I apologize for the confusion. I would like to have all my "shares" on an extra HDD in my desktop. I have a /root SDD, a /home 2TB HDD, a extra 2TB ext4 spare HDD "shares".

    Ideally I would like to have an admin account managing and serving the shares whether my user accounts are logged in or not.

    I have a fresh install and able to abandon it or modify it if it is easier.

    Again thank you for you time and experience.

    XBMC OS
    Last edited by XBMC old School; March 22nd, 2011 at 06:21 AM.
    Ubuntu-Gnome 17.04, 4.14 Kernel
    Core i7 c/w itx Board / Z87 Chipset
    R9 280OC (Tahiti Pro, Radeon HD 7950/4950 OEM)
    256gb OS, ~8TB of Spinners

  7. #7
    Join Date
    Dec 2009
    Beans
    6,530

    Re: Recursive shared media folders (samba)

    You've actually got a bit of a mess there - it's not your fault as this isn't explained very well anywhere. The are two methods of creating a samba share.
    Usershare ( a.k.a. Nautilus-share ):
    [share]
    path=/media/Family Shares/House Shares
    comment=
    usershare_acl=Everyone:F,
    guest_ok=n
    And Classic-Share:
    [Share]
    path = /media/Family Shares/House Shares
    read only = No
    guest ok = Yes
    As you can see you are using both methods at the same time and in this one example on the same target folder with different parameters. It's anybody's guess if Samba thinks this is a guest accessible share or not. I would get rid of one or the other.

    From your post:
    XXXXXXX@XXXXXXX:~$ net usershare info --long
    I am assuming that user = XXXXXXX has access to all these folders locally on the Ubuntu box. If so then add the following line to the [global] section of smb.conf:
    Code:
    force user = XXXXXXX
    Changing XXXXXXX to the actual login user name represented by XXXXXXX.

    Then restart samba:
    Code:
    sudo service smbd restart



  8. #8
    Join Date
    Jan 2011
    Location
    British Columbia
    Beans
    Hidden!
    Distro
    Ubuntu Gnome 16.04 Xenial Xerus

    Re: Recursive shared media folders (samba)

    Thank you for the clarification! Your right, I have looked through the forum/google and haven't found explicit instructions and/or information about how samba functions/management/ecetera. For dummies is needed.

    sudo chmod -R a+rwX /path/to/someDirectory
    Has fixed my recursive permissions.

    XXXXXXXX is my admin account. I intend to have a dumbed down account for my son and would like to have the shares functioning for my media centre & laptop. Which Samba method is best for that?
    How do i delete the other one?

    Is there any explicit instructions on how to manage user & network permissions with samba? Preferably i would like to have -R for XXX, Laptop & XBMC. And read only for son and wifi users.

    XMBC OS

    Can't say thanks enough.
    Last edited by XBMC old School; March 22nd, 2011 at 08:39 PM.
    Ubuntu-Gnome 17.04, 4.14 Kernel
    Core i7 c/w itx Board / Z87 Chipset
    R9 280OC (Tahiti Pro, Radeon HD 7950/4950 OEM)
    256gb OS, ~8TB of Spinners

  9. #9
    Join Date
    Dec 2009
    Beans
    6,530

    Re: Recursive shared media folders (samba)

    Confused again.

    This is what I'm reading:

    You want Read / Write access for yourself when you log into the Ubuntu machine.
    You want read / write access for remote clients on Laptop and XBMC.
    You want read only access for son - not sure if son is remote or another local login user on the Ubuntu box.
    You want read only access for wifi users - don't know where these folks are coming from.

    If all of these folks are remote users then Usershare is not the way to go. It can set up a guest share or it can require authentication but it's one way or the other. You can't say ( easily ) that I want user1 to have read access and user2 to have write access using usershares.

    I also don't know how XBMC connects to your share. If it's asked for a username and password can it respond?

    To remove either of the type of shares just redo the steps you used to create them. Userhsares - Nautilus, whatever you used to create the Classic shares - go back into it and delete the share.

  10. #10
    Join Date
    Jan 2011
    Location
    British Columbia
    Beans
    Hidden!
    Distro
    Ubuntu Gnome 16.04 Xenial Xerus

    Re: Recursive shared media folders (samba)

    You want Read / Write access for yourself when you log into the Ubuntu machine.
    You want read / write access for remote clients on Laptop and XBMC (XBMC can provide user&password).
    You want read only access for son - local login user on the Ubuntu box.
    You want read only access for wifi users - don't know where these folks are coming from.

    I apologize if i'm frustrating you a bit. I just am not clear on what i can & can't do. Can these types of controls be managed by groups?

Page 1 of 2 12 LastLast

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
  •