Cannot connect to Mac computer via smb in Ubuntu 16.04

I cannot connect to computers on my network running Ubuntu 16.04. I get stuck in a never ending username and password dialog loop forever.

I can ssh into the machine, and I can mount it in filesystem using ssh://hostname/share.

I know this question is a duplicate, but known solutions have not worked for me.

I tried adding

client use spnego = no 

to my /etc/samba/smb.conf file, just below where it says global (line 29).

That caused a different error:

Failed to retrieve share list from server. Connection timed out.

smbclient //host/share -U <username>:

NTLMSSP packet check failed due to short signature (0 bytes)!
NTLMSSP NTLM2 packet check failed due to invalid signature!
session setup failed: NT_STATUS_ACCESS_DENIED

Any ideas?

I can connect to servers on the network just fine. Right now the only issue seems to be Mac computers. (I haven't had an occasion to try to connect to a windows machine).

I'm new to Ubuntu, so I am unsure what else to try offhand.


I have the same problem using Xubuntu 16.04 and Mac 10.11.6. The best answer I could find Access OS X file share from Ubuntu

If using SMB then with El Capitan Apple have recently implemented a new change intended to enhance security. This involved signing all the network packets. Some SMB clients cannot cope with this feature although I would expect a Linux machine running a recent version of SAMBA4 to be able to. It may require enabling a matching option in SAMBA. It is however possible to turn this feature off on the Mac server by doing the following.

sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server SigningRequired false

and

writing the following to /etc/nsmb.conf

[default]
signing_required=no

Apple officially has a how-to article of above method here.

However, I still cannot access Mac SMB share from my linux.

Current workaround is to use AFP protocol and Netatalk according to this guide


I found the working solution from Apple discussion (which involves mounting with specific option)

The key is the "nounix,sec=ntlmssp" options

So, I have to mount with

sudo mount.cifs //mac.server.address.ofcomputer /mnt/Mac -o nounix,sec=ntlmssp,username=myusername

For smbclient, you may need --option="ntlmssp_client:force_old_spnego = yes" as suggested on the samba-technical mailing list.

This now lists shares on a Mac OSX server:

smbclient -U$user%$password -L $mac_osx_host --option="ntlmssp_client:force_old_spnego = yes"

For mounting, you may need to add the nounix,sec=ntlmssp options as already suggested here.

I didn't need to change any configuration on the Mac OS X side.


Same problem on 16.04, could not connect to my mac anymore using smb. (before I could, but I don't know the changes which it made fail).

Solution for me is to use afp instead of smb: In Nautilus (file manager) go to File > Connect to server.

Server address:

afp://[nameofyourmac].local

or

afp://[ip address of your mac]

On Mac: System Preferences->Sharing->Option:

  • Select “Share files and folders using SMB.”
  • Choose your user in the "Windows File Sharing List".

See https://support.apple.com/en-au/guide/mac-help/mchlp1657/10.15/mac/10.15.

Don't know why, but it works for me with macOS Catalina and Ubuntu 18.04.