Trying to connect OS X to Samba share under Ubuntu.

Discussion in 'Other Operating Systems' started by flu!d, Apr 30, 2016.

  1. flu!d

    flu!d Never perfect, always genuine

    Joined:
    Jun 27, 2001
    Messages:
    19,825
    Ok,

    So I've been forced to get a Mac due to the number of Apple machines I'm working on these days, and I've come across a little issue...

    How the hell do you get OS X El Captian 10.11.4 to connect to a Ubuntu 16.04 Samba share!

    I go CMD+k, type cifs://192.168.0.13 in the server address field, hit connect, the Mac finds the server, I enter my username and password and immediately get a 'There was a problem connecting to the server 192.168.0.13' error. I know this is defiantly my username and password, but the Mac will not authenticate the machine! I know the Samba share is working fine as it is shared with every other device in the house, namely 2 x Windows PC's, 2 x Nexus 9's, 2 x Nexus 5's and a WDTV but for the life of me I simply cannot get my main Ubuntu Mate 16.04 machine to authenticate on the Mac!

    Any ideas?

    [​IMG]
     
    Last edited: Apr 30, 2016
  2. dukkie

    dukkie Member

    Joined:
    Oct 9, 2002
    Messages:
    1,750
    Location:
    Melbourne
    Have you tried smb://192.168.0.13 instead? That should work :)

    It's how I connect my macbook to my ubuntu server
     
    Last edited: Apr 30, 2016
  3. Emmdee

    Emmdee Member

    Joined:
    Feb 13, 2016
    Messages:
    41
    Location:
    Chantilly, France
    Yep, connect to a Samba share using the Samba protocol, not CIFS!
     
  4. OP
    OP
    flu!d

    flu!d Never perfect, always genuine

    Joined:
    Jun 27, 2001
    Messages:
    19,825
    Sorry, should have mentioned that, SMB isn't working either, that's why I tried CIFS.
     
  5. Perko

    Perko Member

    Joined:
    Aug 12, 2011
    Messages:
    4,529
    Location:
    NW Tasmania
    Try putting the share in the path, could be refusing to let you browse the root maybe?
     
  6. General_Cartman

    General_Cartman Member

    Joined:
    Apr 28, 2005
    Messages:
    2,749
    Location:
    The Confedaracah!
    I've never had any dramas connecting my Macbook to my NAS which is running Ubuntu 14.04 LTS, despite Apple's crappy SMB implementation. Do you get the same error if you use smb://<ip address>?

    Does it work if you allow guest access to shares on the server? It's also possible that OSX just doesn't support the version of Samba that comes with Ubuntu 16.04. You could always try http://eduo.info/apps/smbup
     
    Last edited: May 2, 2016
  7. OP
    OP
    flu!d

    flu!d Never perfect, always genuine

    Joined:
    Jun 27, 2001
    Messages:
    19,825
    Cheers General_Cartman,

    As mentioned earlier, I've tried smb:// <ip address> and still cannot get the Ubuntu share to authenticate, and I've got guest access enabled.

    I think you're spot on though, I think OS X's crappy SMB implementation doesn't like my version of Samba for whatever reason. As far as I can tell, OS X is finding the server, but cannot authenticate the login credentials, which is odd as everything else in the house connects to this machine no worries.

    Smbup looks interesting, will check it out.:thumbup:
     
  8. General_Cartman

    General_Cartman Member

    Joined:
    Apr 28, 2005
    Messages:
    2,749
    Location:
    The Confedaracah!
  9. SpudBoy

    SpudBoy Member

    Joined:
    Jul 30, 2001
    Messages:
    5,314
    Location:
    Under the Bed.
    the other method is to install the open source implementation of smb onto the mac os system (replacing apples version). while this has worked for me in the past it is messy and every time apple does an update it tends to go awry. (dont bother with appletalk, apple have depreciated it)
     
  10. OP
    OP
    flu!d

    flu!d Never perfect, always genuine

    Joined:
    Jun 27, 2001
    Messages:
    19,825
    The fact that you cannot get an OS X El Capitan device to connect to a Linux Samba share without workarounds in this day and age is pretty laughable IMO.
     
  11. General_Cartman

    General_Cartman Member

    Joined:
    Apr 28, 2005
    Messages:
    2,749
    Location:
    The Confedaracah!
    AppleTalk was removed from OSX ages ago. However Netatalk supports AFP which isn't deprecated as far as I'm aware?
     
  12. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    45,335
    Location:
    Brisbane
    Clarification:

    SMB and CIFS are the same thing. Yes, really. Vendors (not any one in particular - Sun/Oracle, IBM, Microsoft and Apple all have a hand in SMB/CIFS) try to confuse the issue with different names for different things, but they are the same.

    Specifically under MacOSX and Apple's lingo, "cifs://" forces a share to connect using SMB protocol 1.0. If you specify the URI with "smb://", you will connect at the highest common SMB protocol available at both ends (from 1.0 up to and including SMB protocol 3.0, under 10.11 El Capitan).

    There is no such thing as "The Samba Protocol". Samba is an open source implementation of the SMB/CIFS protcols, as well as a very large volume of surrounding technologies that manage authentication and authorization of users (mostly emulating both a WindowsNT4 domain controller, as well as an Active Directory 2000 through 2008 domain controller).

    There are really no differences between SMB and CIFS at the technology level. Both are just marketing names for the same concepts (CIFS in particular was chosen to try and lure people away from NFS, and is entirely a marketing jargon thing). Apple's insistence on using them to differentiate between versions of the protocols is not only confusing, but also inaccurate. All the same, it's worth knowing if you need to test an older version of the protocol for some reason (which does perform differently under OSX in certain circumstances, again mostly due to Apple's stupidity).

    More clarification: Appletalk and AFP are somewhat related, but ultimately two different things. AppleTalk was a collection of things, including a communication protocol down at the layer2/3 in the OSI model, that was more akin to IPX (compare and contrast to TCP/IP). It also contained a file sharing protocol with it, which was called the "Appletalk Filing Protocol", or AFP.

    Many years later, Apple dropped support for both AppleTalk and IPX, and standardised on TCP/IP like everyone else. They also modified AFP so that it could use TCP/IP as it's transport, and that is still alive in OSX today. It was also renamed "Apple File Protocol" to drop the association with AppleTalk, and try not to confuse people.

    You can run the open source software Netatalk on any *nix system, and share files with an Apple client using AFP. In fact, if you want to set up a Time Machine backup share, AFP is the only supported protocol (due to how Apple deal with sparse bundles and metadata and a few other complex bits that Time Machine needs). Where I work, I build a large multi-terabyte store on a Linux VM running Netatalk 3.1, and via Puppet run commands on every Mac in our offices (about 250 of them all up) to keep them all backed up with Time Machine.

    It's worth noting that file sharing over AFP is certainly doable, however the protocol is quite poor compared to SMB for complex, busy shares. My Time Machine example is different due to the way that clients claim their own unique directories, but for general file sharing (say, like documents and images), you really don't want more than 10-15 people on an AFP share, otherwise things get very slow.

    On your Linux server, check in /var/log/samba for any log files that match the IP and/or hostname of connecting client. If that appears, you at least know the Mac is seeing the listening service, and attempting a connection. From there, dig into the log files and see what shows up.

    At this point, there are nearly unlimited things that can go wrong. So I won't do further "if:then" type scenarios until you know more.
     
    Last edited: May 2, 2016
  13. OP
    OP
    flu!d

    flu!d Never perfect, always genuine

    Joined:
    Jun 27, 2001
    Messages:
    19,825
    I checked for log files in /var/log/samba matching the IP of the Mac and found no entries Elvis, it appears I was wrong, the Mac isn't finding the listening server at all.

    There was, however, numerous entries from the various other devices that have connected just fine...:rolleyes:
     
  14. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    45,335
    Location:
    Brisbane
    I'm going to take a bit of a stab in the dark here, based purely on experience and not anything that's been posted.

    MacOSX relies heavily on Bonjour, which is its Zeroconf/mDNS implementation. There are glaring incompatibilities between it and Linux's implementation called Avahi, which can sometimes cause issues (often issues that look like network problems, but are actually namespace/resolution problems [1]).

    On your Linux box, try to stop the Avahi daemon by whatever method is distro appropriate. Once that's done, try connecting to your share again from the Mac, and see what happens.

    If it's still buggered, it might be time to fire up nmap and try to find out what the Mac is seeing listening on the Linux box.

    [1] I consider mDNS to be a very stupid solution to something that's not a problem. I don't favour either MacOSX nor Linux on "who is right" in their implementation of it. IMHO they're all stupid for bothering with it. But that's a whole other rant.
     
    Last edited: May 2, 2016
  15. OP
    OP
    flu!d

    flu!d Never perfect, always genuine

    Joined:
    Jun 27, 2001
    Messages:
    19,825
    Ok,

    I stopped the Avahi service daemon using the command in the screenshot below and attempted to reconnect using the Mac, still no go sadly.

    [​IMG]
     
  16. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    45,335
    Location:
    Brisbane
    Need to run that as sudo to make it happen for reals, usually.

    You can check if it's listening with:

    # sudo netstat -plutn | grep avahi

    Next step is to install nmap on the Mac:
    https://nmap.org/download.html#macosx

    And then scan from the Mac to the Linux box to see what it can see. I would use (running on the Mac):

    # sudo nmap -sS -vv -A 192.168.0.13
     
  17. ^catalyst

    ^catalyst Member

    Joined:
    Jun 27, 2001
    Messages:
    11,992
    Location:
    melbourne
    Stupid question, can you ping both ways?
     
  18. OP
    OP
    flu!d

    flu!d Never perfect, always genuine

    Joined:
    Jun 27, 2001
    Messages:
    19,825
    Actually Elvis, it appears I was right, there is a log for the IP address of the Mac. I even tried deleting the log file, attempting to reconnect the Mac and looking for a new log file made today and a new log file with the correct IP address was made today in /var/log/samba.

    Oddly, upon running the above command without sudo I was prompted for authentication in the form of a pop up requester.

    [edit] I can ping in both directions just fine.
     
    Last edited: May 2, 2016
  19. elvis

    elvis Old school old fool

    Joined:
    Jun 27, 2001
    Messages:
    45,335
    Location:
    Brisbane
    Anything interesting in that log file?
     
  20. ^catalyst

    ^catalyst Member

    Joined:
    Jun 27, 2001
    Messages:
    11,992
    Location:
    melbourne
    protip too flu!d, pastebinit.

    cat /some/log/log.log | pastebinit

    pipes output of command to paste.ubuntu.com and gives you a link.
     

Share This Page

Advertisement: