Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

file-sharing between mac and ubuntu-linux

I have a MacBook Air, High Sierra 10.13.1 and a Ubuntu-computer 16.04.

Both have samba installed (in mac default). My mac can reach and use shared-files on my ubuntu-computer, logging in as "guest".


The other way round does not work. The login window repeats itself endlessly. So no login possible. Not even "anonymously", so that password isn't necessary.


What is the cause of this. Does mac samba server not accept linux-clients??


I didn't succeed in solving this. Can anyone help me out?

MacBook Air, iOS 10.3.1

Posted on Dec 11, 2017 12:06 PM

Reply
21 replies

Dec 11, 2017 10:40 PM in response to Drew Reece

Dear Drew Reece,


Thanks for the information.

But I was already aware of this article.


As I pointed out: I can log into the shared folder on my ubuntu machine from my mac. But the other way round does not work. There are rather strange issues.


When I tried to connect from the cli, I got the following answer:

[code]$ smbclient -L MacBook-Air-van-Marc.local

WARNING: The "syslog" option is deprecated

Enter marc's password:

session setup failed: NT_STATUS_LOGON_FAILURE[/code]


So: my ubuntu cant log in. That's clear enough.


Nevertheless it can [b]contact[/b] the mac, as the "nmblookup" command shows:

[code]$ nmblookup -AS 192.168.x.xxx

Looking up status of 192.168.x.xxx

MACBOOKAIR-Dxxx <00> - H <ACTIVE>

MACBOOKAIR-Dxxx <20> - H <ACTIVE>

WORKGROUP <00> - <GROUP> H <ACTIVE>


MAC Address = <een aantal letters en cijfers>[/code]


So: why is there that: "NT_STATUS_LOGON_FAILURE"??


On the graphical plain: when I use the gui in "nautilus" (graphical file-manager in ubuntu)to log in, I get this window:


User uploaded file


I get the choice of login in as a registered user, with password, or "anonymously", without password.

Neither works! The login window disappears and reappears endlessly!


I do not know is the developers are aware of this issue?

It does not ruin my life! I installed SSH/SFTP protocol and that works perfectly in both directions between mac and ubuntu. But I want to solve this strange samba-puzzle. Or at least find out what causes it.


Thanks for your patience and attention.

Marc.

Dec 16, 2017 10:52 PM in response to marcfromkluisbergen

Dear Drew,


I have one more question:

Is the samba-server installed on the ubuntu?


Then: the situation is different:


Yours: ubuntu 17.04, Mac OS 10.9.5

mine: ubuntu 16.04 (samba-server installed), Mac OS 10.13.2


Although I allowed "guest" the way you showed me, the login window does not give me a choice between "anonymous" and "user-password".


The things I have been reading - concerning this "modified samba implementation"- tell me that the situation has changed.

It seems to be more problematic. I get the impression that apple is more or less abandoning the samba-project. (Again: why is there no nsmb.conf file anymore? That's weird.)


On the other hand: I'm enjoying using the mac-notebook.

When my old Asus-laptop broke down, I decided to buy a mac. Its an OS I never used. It's very elegant and handy.

But one must learn to accept the commercial limitations.

In linux, there are no secrets.

Here, on the mac, I have no way to find out where this "mysterious modified samba-implementation" is hidden, not to say: configure it.


But otherwise the mac is great!


And I can dance a sensual samba with it, thanks to the ubuntu-server! 😁

Dec 11, 2017 12:39 PM in response to marcfromkluisbergen

Enable file sharing on the Mac & setup a password for a user account on that Mac.

See the 'Advanced Options' section…

https://support.apple.com/en-us/HT204445


That should allow Ubuntu to see & connect to the Mac. SMB on the Mac can be wierd sometimes as Apple had to make their own version several years ago due to the licensing of the Samba project.

Dec 14, 2017 11:33 AM in response to marcfromkluisbergen

Xcode will not have installed Samba in /opt that will be from some other command. Mac ports may have it as a dependancy for another project. I don't know if KDE can be installed via Macports, as far as I know that's not compatible. It's been years since I touched Macports so I can't think how to list what is dependant, 'port info samba' looks appropriate at a glance


There have been issues with Apples SMB sharing over the years but it mostly works.

It is their own code and as such new projects often have minor incompatibilities, quirks etc. It should work without Samba3 from Macports in the way. I don't know if Ubuntu 16.04 is specifically compatible with the built in Apple server but it should be. If I get time I may be able to test, but it seems pointless as I don't specifically have 10.13 available at the moment.


I would remove samba via Macports & see what happens. Reboot to allow Apples server the ability to gain access to the correct ports once samba 3 is not trying to access them (just a guess on what could happen).


man nsmb.conf should help with the config. I don't know why there is no existing one, I don't have one either, the default options will have been created during the compiling of the project.

The Apple manuals are normally online too…

https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPag es/man5/nsmb.conf.5.html


Note the files section near the bottom,

nsmb.conf manual:


FILES
/etc/nsmb.conf The global configuration file.
~/Library/Preferences/nsmb.conf The user's configuration file, conflicts will be overwritten by the global file.

You can have your own config per user - probably safer than editing one in /etc/ it will alter the share for that user account, I'd probably create 2 mac user accounts & tweak one config file to compare changes if things were not working.

Dec 15, 2017 12:25 PM in response to Drew Reece

As promised here are my test results, these OS's are what I had installed in a form that I could test easily…

Ubuntu 17.04, Mac OS 10.9.5 (I may test High Sierra too if I have access to it with enough time).


On the Mac

  • I enabled guest access in Users & groups
  • Enabled file sharing
  • Checked that SMB was active in the sharing options
  • Added a folder for sharing so it was listed under the 'Shared folders' box


On Ubuntu

  • I used Nautilus to connect
  • Select the 'Other locations' in Nautilus sidebar
  • "MyMacName (File Sharing)" is shown under the Networks section clicking that shows the 'shared folders' on the Mac
  • Clicking one of those shared folders opens a dialog to for the user credentials
  • Choosing the 'anonymous' option seems to connect as a guest.

    Accessing files works as expected. I cannot save files as I do not have permission for editing some of them - the share needs to be setup for guest access.

  • I ejected the share from the sidebar & tried again using my OS X user account name & password

    Accessing files works as expected.

  • Disabling the guest access on the Mac removes the 'anonymous' option as expected


marcfromkluisbergen,

SMB sharing from Mac OS to Linux works fine as far as I can see.

You seem to have confused your settings with the Macports Samba install (seriously, just remove it). If something is not working please ask here first and avoid jumping into Terminal, it is too easy to choose the wrong tools, macOS is not Linux so it can be confusing when using both.


As for the Gwenview app is there anything that it can do that Apple's Preview app can't? Preview is built in & doesn't add a ton of external dependancies. I know it is possible to run some Linux tools on a Mac but as you appear to be a novice (no offence intended) running with the stock applications may be better, simpler, safer… Macports can also get out of date, so they start to become a security risk over time as flaws are found in the tools they install.



P.S. The Ubuntu is showing the Macs bonjour name in Nautilus (shown in the Macs sharing preferences as something.local) so that is a sign that bonjour works on Ubuntu. It means Ubuntu can automatically discover it - no need to enter IP's for access.



I hope this helps.

Dec 12, 2017 7:31 AM in response to marcfromkluisbergen

I tried the following command on my macnotebook: "smbutil view -g".


It found my samba-server on my ubuntu-machine.

But it dindn't find the samba-server on my mac. Got the following output:


"smbutil: server rejected the authentication: Authentication error".


What does it mean, or what is the reason for this?

File-sharing is activated on my mac!

Is it overruled by the server on ubuntu? Or something of the sort?


I am an absolute beginner on the subject of Samba en yes: dont give me the RTFM treatment 😊.

Its very difficult stuff for the layman. I can use some help. And if its actually a bug, then there is very little one can do.

Dec 12, 2017 10:53 AM in response to marcfromkluisbergen

marcfromkluisbergen wrote:

[code]$ smbclient -L MacBook-Air-van-Marc.local

[code]$ nmblookup -AS 192.168.x.xxx

Looking up status of 192.168.x.xxx

I see you are using the .local address in the first command that fails & the IP in the second that works.


.local addresses are bonjour (a.k.a. rendezous, zeroconf, avahi, multicast DNS - it has had many names). Have you tried connections only using the IP address?


If the IP works & the local name does not you will need to investigate bonjour on Ubuntu. Bonjour is basically DNS on the local network that works by broadcasting service info (apologies if you know all this already).


If the exact same error messages persist with the IP you know that Ubuntu is finding the server but the SMB protocol is choking or failing for some reason.


The reason I suggested using a user account with a password is because I'm not certain how well guest logins work over SMB on Macs. I avoid those & have not tested it.



Do you need to suggest a username with smbclient? e.g. change

smbclient -L MacBook-Air-van-Marc.local

to

smbclient -L MacBook-Air-van-Marc.local -U [username on the Mac]

I'm assuming marc is the user on Ubuntu? Does the Mac also have a user called marc too?

From the manual… 🙂

If no username is supplied, it will default to an uppercase version of the environment variable USER or LOGNAME in that order. If no username is supplied and neither environment variable exists the user name will be empty.


I'd also specify a workgroup when testing as the next of output line looks a little odd…

WORKGROUP <00> - <GROUP> H <ACTIVE>

What a happens with…

smbclient -L MacBook-Air-van-Marc.local -U [username on the Mac] -W WORKGROUP

If that helps perhaps the smb.conf needs checking…

samba - smbclient getting NT_STATUS_LOGON_FAILURE connecting to Windows box - Ask Ubuntu

NOTE:

This is all speculative, I can't tell what is going wrong but I think Ubuntu can see the Mac (bonjour is probably working, but rule it out by using just the IP anyway) but the authentication seems to fail.

Dec 13, 2017 3:10 AM in response to Drew Reece

Thank you for this information.


I set a password with "smbpasswd" on mac for user "marc". When I log in with "smbclient" from ubuntu, I suppose this is the password asked for? Nevertheless it is not accepted (or something else in not accepted).


Reading the samba-manuel (and also understand it) is a lot of work.

I'm afraid I'm an absolute beginner, and I need a lot of study. (But I'm not "geekish" at all, just an ordinary mac-newbee, hoping that things work, out of the box).


I can use the samba in one way: I can reach the shared-map on my ubuntu from the mac.


Does that mean that the ubuntu-samba-server uses the mac as smb-client, but that the mac-server can't use the ubuntu as a client?


I have only two machines on my LAN: the ubuntu and the macnotebook (used mostly outdoors). That's the reason for using samba: getting stuff from my home-computer, working outdoors with the mac.

I'm glad it works in one direction, so I can actually use it.


Not being able to reach the shared-map on the mac does not really matter. I'm only curious why it does not work.


I read somewhere, that on a LAN, you should set only one machine as the "master-browser" on the network. You can look up the master with the command "nmblookup -M - --". I did this on both machines. On the ubuntu it mentions the ubuntu-server. The server on the mac wasn't mentioned. On the mac nothing was found.


As you can read, this is the gibberish of a layman.

I still know very little (or nothing) about domains etc.

I discovered the "systempreferences>share>File Sharing" option on the mac, activated it and merrily tried to log in on the mac from my ubuntu, and it didn't work. Then I installed the samba-server on my ubuntu.

Maybe the two servers conflict?


If I find the time and the courage, I'll study the damned thing.


Thanks for all your trouble.

Marc

Dec 13, 2017 6:30 PM in response to marcfromkluisbergen

I'm having a hard time following.

What was the exact output on the Mac for

'nmblookup -M - --'


As far as I am aware that command is part of the Samba project tools, Samba is no longer installed on Macs as the license does not allow it (somewhere around 10.8 it got removed if I recall correctly).


Sorry I don't have 10.13 running in front of me so I should probably leave it to others. Initially I thought it was a simple config issue.

Dec 13, 2017 11:02 PM in response to Drew Reece

Dear Drew,


Samba is installed on High Sierra.


You can find it: "/opt/local/etc/sabma3".


The configuration file is called: "smb.config.sample"


What I suspect is: it has been modified, so that you can log in from other mac-machines or from windows-machines. (Samba was originally developed for sharing files and printers between unix/linux- and windows-machines.)


I can only assess that the mac-version makes it very difficult for ubuntu-linux, to log in.


This feature: "system preferences>share>enable file sharing" is a function of samba.


The command "nmblookup -M - --", executed on the mac, shows this:


"querying __MSBROWSE__ on 192.168.0.255


192.168.x.xxx(=ip-adress of ubuntu-machine) __MSBROWSE__<01>"



Which - as far as I understand - means that only the ubuntu-samba is considered as server.



Look... this is only conjecture from my side. I'm the layman here.


I wonder if this issue has been looked into by the developers of the file-sharing-project on mac?

Dec 14, 2017 12:34 AM in response to marcfromkluisbergen

/opt/local is not an 'Apple default path'. You must have installed that from another source, potentially Macports, Homebrew or another command line 'package tool' that installs command line tools.


Apple install it's tools in /usr /bin and /sbin, for example the command

which smbutil

returns '/usr/bin/smbutil'


Apples default config files are also in /etc not /opt/local/etc.


Try the following to see where the binaries are installed…

which nmblookup

If that is within /opt it is not default, which may explain why you are having issues, running Apple's own smb server & samba will lead to conflicts as both will want to use the same ports - not going to work.


Here is the info about Samba & OS X (now macOS)…

http://appleinsider.com/articles/11/03/23/inside_mac_os_x_10_7_lion_server_apple _replaces_samba_for_windows_networking_s…


I'm still convinced Samba isn't installed, it is Apples own version instead that has different config and cli tools to Linux.

Dec 14, 2017 9:21 AM in response to Drew Reece

Now were getting somewhere!


My god... you are right! MacPorts installed samba.

How this happened, I don't even know. I didn't install it intentionally. But there it is!

The command: "port installed" gave "samba3 @3.6.25_2 (active)".

Also "kerberos5 @1.15.2_0 (active)".


Before we go into it further - and I start to delete or uninstall things - I want to know something crystal clearly:

If I hadn't installed MacPorts, that - without my intention - installed samba3, as part of an installation I made (kde?... Xcode?): are there issues, logging in from a linux machine, when the option "file sharing" on the mac is activated?

I mean: do you have noticed complaints, reports about that?


If it is so, that there are normally no problems using the file-sharing option, between mac- and linux-machines, I could proceed to uninstall the macports-version, and see what happens.


Another question: why is there no nsmb.conf file in my /etc ?

Dec 14, 2017 11:41 AM in response to marcfromkluisbergen

I deactivated the samba in MacPorts (found out it was automatically installed when I installed kde's "gwenview" - I only wanted "gwenview", but apparently got all the rest of kde also!😝)


So, what a surprise for the blundering, experimenting layman!


Nevertheless: I deactivated this blasted samba, but I can still not log in into the mac to reach its Public Folder (supposed to be the shared folder).

Always the same: the login window is endlessly repeating itself.

I strongly suspect: logging in from a linux-machine is not allowed by this apple-samba-emulation!

I'm I right?

If you know any ubuntu-users who have also mac-machines on their LAN, please, ask them if they have the same problem as I have.


I am not desperate at all. I use the SSH/SFTP connection an my LAN and that works just fine.

file-sharing between mac and ubuntu-linux

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.