0

This is my first attempt at setting up a network, so I apologize if some of this should be obvious.

I'm attempting to share a directory between my Ubuntu 18.04 desktop and my MacOS High Sierra 10.13.5 MacBook Pro using Samba.

Here's what I've done thus far:

I've done the following on my Ubuntu Desktop:

$ sudo apt install tasksel  
$ sudo tasksel install samba-server  
$ sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup  
$ sudo bash -c 'grep -v -E "^#|^;" /etc/samba/smb.conf_backup | grep . > /etc/samba/smb.conf'  
$ sudo smbpasswd -a <username>  
$ sudo nano /etc/samba/smb.conf  

Then I added the following lines to /etc/samba/smb.conf, before saving it

[Shared File Name]
    comment = Ubuntu File Share
    create mask = 0777
    guest ok = Yes
    path = path/to/shared/file
    read only = No

And

$ sudo service smbd restart  
$ sudo chmod 0777 path/to/shared/file

Then I determined the IP address of the Ubuntu desktop using this site: https://whatismyipaddress.com/?u=TRUE

Then on the mac, I did the following:
1) Disabled the FireWall
2) Opened Finder
3) Menu Go -> Connect to server (command-k)
4) entered smb://UBUNTU-IP-ADDRESS in the “Server Address” text box
5) Pressed Connect

At this point I get the following error:

There was a problem connecting to the server "UBUNTU-IP-ADDRESS" The server may not exist or it is unavailable at this time. Check the server name or IP address, check your network connection, and then try again.

Other Info:

I'm trying to network these computers with WiFi rather than through ethernet cables, so I can use the Mac Laptop anywhere.

On my Ubuntu system I have a mounted file (icon of an ethernet port overlays the file) that appeared on my desktop labeled: "Shared File Name" on user-desktop.local

This mounted file contains the folders and files of the desired directory I'd like to share across the network. However, some of the folders have been renamed with names like _9GP6I~F.18 or _13ZOZ~B.18 while others have kept their original name.

At this point my questions are:
1) What mistakes have a made that don't allow me to mount the folder on my Mac?

2) Are there other things I need to do with the Mac, to get it to connect to a Network. Online tutorials have hinted at this but I couldn't find any concrete steps.

3) Are there naming conventions for folders and files that must be followed to avoid the renaming that occurs in the file mounted on the Ubuntu Desktop?

Thank you for taking the time to read this, I appreciate any input.

cmak.fr
  • 8,696
Osuynonma
  • 119
  • I'm actually quite confused by your post. Like why you are using tasksel in a desktop system. But the biggest is your use of whatismyipaddress.com to find your ip address. Are you trying to access this server from a client on the internet or on your home lan? If it's a home lan that will not give you the local lan side ip address if your Linux box. – Morbius1 Jun 16 '18 at 21:16
  • I was following this tutorial here: https://linuxconfig.org/how-to-configure-samba-server-share-on-ubuntu-18-04-bionic-beaver-linux Do I just need to set a static IP, and use a different samba set-up? – Osuynonma Jun 17 '18 at 20:54
  • It seems you have your answer here because you described your question correctly: https://superuser.com/questions/1331675/network-between-macos-10-13-5-and-ubuntu-18-04/1331776#1331776 Something you neglected to do here. – Morbius1 Jun 19 '18 at 19:50

2 Answers2

0

Note: I still don't know if you are trying to access this ubuntu machine in a local network or from the internet. This answer assumes it's a local network.

If you are using Ubuntu 18.04 desktop what you are trying to do is automatic. Even if you are using Ubuntu Server it will be automatic if you install avahi-daemon.

Ubuntu 18.04 is the first Ubuntu LTS that compiled samba support for something called "multicast dns registration". When you install samba ( sudo apt install samba ) your Ubuntu box will announce itself to the rest of the local network using Avahi ( Bonjour in macOS ). Your machine will automatically show up in the side panel of Finder under Shared. All of this is automatic and doesn't require any action by the user.

The only things that I can think of that will mess this up is:

[1] avahi-daemon is not running or is being prevented from running. To see if it's running:

sudo service avahi-daemon status

If it's not running start it:

sudo service avahi-daemon start

Then check it again:

sudo service avahi-daemon status

[2] Your Ubuntu firewall is in the way. To stop it:

sudo ufw disable

If you are compelled to use an ip address for some reason use the one that is applicable to a local network ( assuming that is what this is ). To find that ip address use: "ifconfig" or:

hostname -I
Morbius1
  • 7,761
  • I'm trying to connect via WiFi. For a local network do I need to connect the computers via ethernet cable? I'm not seeing the computer in Finder. Thank you for your help. – Osuynonma Jun 18 '18 at 14:20
  • My advice to you is to ask this question in the Ubuntu forum: https://ubuntuforums.org/index.php because it is not even clear to me now that you have a router in your home lan. Try to describe as mush as possible how your network is set up and post the output of the following commands so the folks there can see how samba is configured: "testparm -s" "net usershare info --long" – Morbius1 Jun 18 '18 at 15:29
0

What this question really is about is creating an ad-hock wireless network between an Ubuntu machine and a MacBook and using samba to share files.

Part of this is already been answered here specifically for Ubuntu 18.04: How to setup an Access Point mode Wi-Fi Hotspot?

It goes into more detail than I would have but it comes with screenshots. One thing I would point out is that after you create the HotSpot is will tell you what the network name is and what password your macbook has to use to gain access.

WHat's missing is what to do on the Mac. If you click on the network icon on the upper taskbar you will eventually see the Ubuntu "network name" that you created by creating the HotSpot. It will ask for the password that I mentioned above.

After that Finder will show the Ubuntu host name under Shared.

About the only thing I would change is your share definition. I would change it to this so that you avoid any permissions issues:

[Shared File Name]
    comment = Ubuntu File Share
    create mask = 0777
    guest ok = Yes
    path = path/to/shared/file
    read only = No
    force user = albert

Change albert to your ubuntu login user name.

Morbius1
  • 7,761