Ubuntu – How to access shared folders on Ubuntu server from Mac OS

11.04macosxsamba

I have an old dell desktop running ubuntu 11.04, I also have samba installed on it. I'm trying to access the shared folders on the Ubuntu machine from my Mac, so I go into 'Finder', click on 'Go' and 'Connect to Server'.

I type in the ip address of the ubuntu machine smb://xxx.xxx.x.xx and click connect, I can then see the list of shared folders from the ubuntu machine so I know its making a connection. But when I access the 'Music' folder I get an error message stating:

There was an error connecting to the server "xxx.xxx.x.xx". Check the server name or IP address, and try again.

Any thoughts anyone ?

EDIT
I have a external hard drive attached to the server, and the folders I'm trying to access are located on that external hard drive.

The location of the folder is /media/HD-CELU2/test, so I think the path from Finder should be smb://xxx.xxx.x.xx/media/HD-CELU2/test, but having tested this, I'm still not getting in.

P.S. I'm using Samba as I have a Windows machine on my home network as well.

Best Answer

I would go on the Mac to the net info then to machines and search for Ubuntu PC's name, copy that name, and use it instead of the IP address. In Finder do: Go -> Connect To and then smb://name/user or smb://` and type in your credentials.

Make sure the samba server (your Ubuntu server) is configured correctly:

Type the following:

 sudo gedit /etc/samba/smb.conf

Rename MSHOME to WORKGROUP or whatever your workgroup's name is.

Then go to the line where the security is defined and add ; at the beginning of the line.

Scroll to the bottom of the file and add/edit your shared folders as follows:

[<folder_name>]
path = /home/<user_name>/<folder_name>
available = yes
valid users = <user_name>
read only = no
browseable = yes
public = yes
writable = yes

Save and restart samba with:

sudo /etc/init.d/samba restart

or

sudo service smbd restart

depending on the version of Linux you're using.

If you haven't already done so, create a user with:

sudo smbpasswd -a yourname

Now go to the network settings and give your Server IP, subnet mask and gateway. You can then connect on the Mac as previously stated (Go -> Connect To -> smb://)

On the Linux box, you need to right-click whatever folder you want to share and go to Network Share or Properties and then click Sharing and click Share This Folder.

To test that your share is working correctly, type

testparm

and you'll see output similar to the following:

Load 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$]"
Processing section "[<folder_name>]"
Loaded services file OK.
Server role: ROLE_STANDALONE

Lifted from instructions here and originally found here.

This worked on MacOS Sierra Version 10.12.

Related Question