OS X Samba Issues

OS X Samba Issues

Having trouble connecting your Mac to a Samba share? This may be the answer(or rather work around) to get you back up and running.

If you follow us, you may already know that I built my own home server and at the time of writing am running SUSE Leap 42.1 with Samba for making a source of truth for all the files Allyson and I need to share. Up until last month this had been working great and both my Windows PC and Allyson’s 2015 13″ MacBook Pro(running OS X 10.11.4) were able to connect without issues. (Ok, so Windows does require an IP address because it has it’s own Samba issues, but it still connects without issue. So it seems Windows 10 and Mac OS X both have old Samba compatibility issues.)

“There was a problem connecting to the server”

At some point about a month ago Allyson’s machine just stopped being able to connect to our home server. We got the error: “There was a problem connecting to the server”. All my Windows and Linux tests showed they were able to connect, with Linux having n0 issues and Windows still requiring the IP address. Strange.

When looking for a fix I found suggestions that were to enable sharing of a local fold on the Mac so it could properly rewrite it’s local Samba config and firewall settings. Another suggestion was to connect via IP but instead of using ‘smb://’ use ‘afp://’ or’ cifs://’. None of these methods worked.

How to fix (The work around)

So this is a bit counter intuitive, because I wanted open access shares on my private network but the fix is to create user level access for the share. I found this suggestion on stack exchange (lost the link, and couldn’t find it again) but hadn’t taken time to look into configuring access so I had skipped it. So seeing someone had verified it recently I thought I would give it a try.

This fix will change the share to restricted access so it may be easiest to create another share with the new restriction solely for your Mac if you want to retain anonymous shares.

Samba add a user with password

So, one of the reasons I avoided this is because, like learning Samba, I thought it would take a while to dig through the documentation and do it right. Turns out it’s not so hard and is rather straight forward. There are a few simple steps to get up and running. First we add a new user to your system. You can do this using the command below in the terminal. (This creates a new user account that can log into the PC, including home directory etc).

mysambuser should be replaced with whatever your new user will be named

sudo useradd -a mysambauser

Once entered it will ask for a password for the new user.

Now you just need to add the following line to your [share] in your Samba config file. (You will want to clean up the anonymous access lines while you are there too).

[mysharename] #Your share name header
valid users = mysambauser

That’s it! Once done you want to restart the Samba service and you should now be able to log in with the new user account you created. This solved our month long issue with being unable to access our home server. I hope this helps and solves your issues as well.

Purchased a NAS but have the same issue?

While searching for an answer I did see that adding username/password access to your NAS can help as well. I don’t have a NAS so I can’t test it but I assume using it’s tools and adding a new user account there should work just as well. So it’s worth a shot if you lost connectivity.

Wrapping it up

Although initially seen as a hassle, it’s actually quiet simple to add proper authentication to your shared folders even when you role your own ‘NAS’/file server. Additionally both Mac and Windows can remember the credentials so you don’t need to enter them each time you want to access the share. This is great, but do remember that if you are concerned about security you need to avoid anonymous access and ensure that these credentials are not stored so viruses and malware can’t access the drives freely if you get infected.

I hope this is useful to those who are new to Samba(similar to myself). It certainly is a fast and easy fix for the Mac OS X Samba issues. If you found anything else out that may help others, please be sure to comment below!

Comments are closed.