Results 1 to 8 of 8

Thread: file sharing permissions between Mac and Ubuntu

  1. #1
    Join Date
    Feb 2014
    Beans
    7

    file sharing permissions between Mac and Ubuntu

    I set up a ubuntu desktop to run with a Plex media server. However, I want to access the ubuntu directory from my mac. The idea is that I have media I acquire on my mac that I then want to move to the ubuntu machine. So, mac --> ubuntu --> plex. I followed this guys mostly GUI sharing set-up using samba. I see from another post that I can use NFS instead. Since I want this to be a one-and-done connection I could use the NFS set-up, but honestly, it runs to multiple pages and I'm looking for the easy way out.

    I had success with the GUI samba installation. I mounted the ubuntu directory onto the mac, I could read the files, but I couldn't add new files, I didn't have permission. When I mounted the directory I connected as the "sharer" user(as described in the previously linked instructions). That worked great until I tried to move a file into the shared directory, Mac's Finder then asked for username and password. I tried both my mac username and password and the sharer username and password. Neither worked.

    I see four possible options going forward:
    1. Set-up the shared directory to share as guest, less secure, but my wifi is secure and i don't think my girlfriend is trying to hack me...
    2. Suck it up and do the NFS file sharing method.
    3. Figure out the permissions required to use the samba user "sharer."
    4. Use a different method to move files(Dropbox local(I've heard there's such a thing, FTP, other)

    Suggestions?

  2. #2
    Join Date
    Dec 2009
    Beans
    6,772

    Re: file sharing permissions between Mac and Ubuntu

    I had success with the GUI samba installation. I mounted the ubuntu directory onto the mac, I could read the files, but I couldn't add new files, I didn't have permission. When I mounted the directory I connected as the "sharer" user(as described in the previously linked instructions). That worked great until I tried to move a file into the shared directory, Mac's Finder then asked for username and password. I tried both my mac username and password and the sharer username and password. Neither worked.
    If you want to pursue the samba part of this you need to post how all of this is set up. Please post the output of the following commands:
    Code:
    testparm -s
    Code:
    net usershare info --long

  3. #3
    Join Date
    Feb 2014
    Beans
    7

    Re: file sharing permissions between Mac and Ubuntu

    testparm results in
    Code:
    oad smb config files from /etc/samba/smb.conf
    rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
    Processing section "[printers]"
    Processing section "[print$]"
    Loaded services file OK.
    Server role: ROLE_STANDALONE
    [global]
        server string = %h server (Samba, Ubuntu)
        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
        idmap config * : backend = tdb
    
    [printers]
        comment = All Printers
        path = /var/spool/samba
        create mask = 0700
        printable = Yes
        print ok = Yes
        browseable = No
    
    [print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers
    and net usershare
    Code:
    path=/home/clayton/Videos
    comment=
    usershare_acl=Everyone:F,
    guest_ok=n

  4. #4
    Join Date
    Dec 2009
    Beans
    6,772

    Re: file sharing permissions between Mac and Ubuntu

    The question is does "sharer" have write access to the Video folder and all it's contents.

    Since "sharer" has been granted access to the share Samba has done it's part so the rest is up to Linux permissions. Run the following command:
    Code:
    ls -al /home/clayton/Videos
    Does anyone other than "clayton" have write access to the Video Folder and everything in it?

    Of course if you've encrypted your home folder you have other issues.

  5. #5
    Join Date
    Feb 2014
    Beans
    7

    Re: file sharing permissions between Mac and Ubuntu

    I'm not really sure why there's a .DS_store file listed. And I'm not sure how to read the rest of it.

    Code:
    total 36
    drwxrwxrwx  4 clayton clayton  4096 Feb  5 06:39 .
    drwxr-xr-x 27 clayton clayton  4096 Feb  5 06:46 ..
    -rwxr--r--  1 sharer  sharer   4096 Feb  5 06:39 ._.DS_Store
    -rwxr--r--  1 sharer  sharer  15364 Feb  5 06:47 .DS_Store
    drwxr-xr-x 34 clayton clayton  4096 Jan 31 17:07 Movies
    drwxrwxr-x 14 clayton clayton  4096 Feb  4 20:35 Tv-Shows

  6. #6
    Join Date
    Dec 2009
    Beans
    6,772

    Re: file sharing permissions between Mac and Ubuntu

    The .DS_whatevers is an OSX thing. The problem seems to be that "sharer" has write access to /home/clayton/Videos itself but only "clayton" has write access to the Movies
    and Tv-Shows subfolders.

    Unless you want to keep changing permissions on everything you might consider adding a line to smb.conf so everything is saved with clayton as owner. If you want to do that:

    Edit smb.conf as root:
    Code:
    gksu gedit /etc/samba/smb.conf
    Then add the following line under the "workgroup = workgroup" line:
    Code:
    force user = clayton
    Save the file then restart samba:
    Code:
    sudo service smbd restart
    Samba will limit access to those who have been added to the samba password database ( smbpasswd ) but once they are in they will be converted to clayton. So when samba allows sharer access to the share he becomes clayton and everything that clayon has access to so does sharer. And everytime sharer saves something to the share it will save with clayton as owner so he can access it on the server locally.

  7. #7
    Join Date
    Feb 2014
    Beans
    7

    Re: file sharing permissions between Mac and Ubuntu

    Morbius, that worked! Thanks. Should I have any security concerns with forcing the clayton user? I guess it's more secure than opening to guest users. Do you know about throughput speeds? I read that NFS might be faster than smb. I understand of course it has a lot to do with the router, just wondering if you had an opinion. I'm getting a speed somewhere around 3MB/sec using an asus N66. Thanks again.

  8. #8
    Join Date
    Dec 2009
    Beans
    6,772

    Re: file sharing permissions between Mac and Ubuntu

    As far as the security concern the "force user" isn't giving access to the credentialed samba client to your entire system only to your samba share.

    As far as speed is concered there is on ongoing debate on what protocol is faster which I can't comment on. I haven't used NFS in decades and it was set up by someone else for me so I have no way to judge which is faster, more reliable, or more secure.

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
  •