# Sharing Files Between Linux Mint and macOS with Samba
If you have a Linux Mint desktop with large internal or external drives attached to it and want to access those files from a Mac elsewhere on your network, **Samba** is one of the cleanest ways to do it.
Samba implements the **SMB protocol**, which macOS supports natively. Once configured, a folder or entire external drive attached to your Linux machine can appear in Finder on your Mac almost like another network drive.
This guide walks through the entire setup, including:
- Installing Samba
- Creating a Samba login
- Finding your Linux machine's IP address
- Sharing normal folders
- Sharing external hard drives
- Finding a drive's UUID
- Giving external drives permanent mount points with `/etc/fstab`
- Adding multiple drives
- Connecting from macOS
- Testing and troubleshooting the configuration
---
## What We're Building
The setup looks something like this:
```mermaid
flowchart LR
A["External Hard Drives"] --> B["Linux Mint"]
B --> C["Samba / SMB"]
C --> D["Local Network"]
D --> E["macOS"]
E --> F["Finder"]
```
The drives remain physically connected to the Linux computer.
The Mac accesses them across your local network using SMB.
---
# 1. Install Samba on Linux Mint
Open a terminal and install Samba:
```bash
sudo apt update
sudo apt install samba
```
Check that the Samba service is running:
```bash
systemctl status smbd
```
You should see something indicating:
```text
active (running)
```
If Samba is not running, enable and start it:
```bash
sudo systemctl enable --now smbd
```
---
# 2. Find Your Linux Username
Run:
```bash
whoami
```
For example:
```text
wm
```
Throughout this guide I'll use:
```text
wm
```
as the example Linux username.
Replace it with your own username wherever necessary.
---
# 3. Create a Samba Password
Samba maintains its own authentication database.
You can enable your existing Linux account for Samba with:
```bash
sudo smbpasswd -a wm
```
You'll be prompted:
```text
New SMB password:
Retype new SMB password:
```
This becomes the password you'll use when connecting from macOS.
It **does not have to match your Linux login password**.
You can see existing Samba users with:
```bash
sudo pdbedit -L
```
### Samba users must normally already be Linux users
For example:
```bash
sudo smbpasswd -a tyler
```
doesn't normally create a Linux account named `tyler`.
If you want to use `tyler`, you'd first need:
```bash
sudo adduser tyler
```
and then:
```bash
sudo smbpasswd -a tyler
```
For a personal home network, it's usually easiest to simply use your existing Linux account.
---
# 4. Find Your Linux Computer's IP Address
Run:
```bash
ip a
```
Or, for a shorter result:
```bash
ip a | grep inet
```
You'll probably see several addresses.
An example might look like:
```text
inet 127.0.0.1/8 scope host lo
inet 192.168.1.71/24 brd 192.168.1.255 scope global enp2s0
inet 172.17.0.1/16 scope global docker0
```
The address you're interested in will usually resemble:
```text
192.168.1.71
```
Addresses beginning with:
```text
127.
```
are local loopback addresses.
Addresses such as:
```text
172.17.
```
may belong to Docker or another virtual network.
For this example, our Linux machine is:
```text
192.168.1.71
```
---
# 5. A Quick Note About External Drives
You *can* tell Samba to share something mounted at a location like:
```text
/media/wm/Birch
```
However, if this is intended to be a permanent network share, I prefer giving the drive a **permanent mount point**.
For example:
```text
/mnt/birch
```
The reason is simple:
> Samba expects the directory in its configuration to exist in the same place every time.
External drives mounted automatically by the desktop environment can occasionally wind up with different mount behavior.
Using the drive's **UUID** in `/etc/fstab` gives Linux an unambiguous way to identify the drive regardless of which USB port it's connected to.
---
# 6. Find an External Drive's UUID
There are a couple of easy ways.
## Using `lsblk`
Run:
```bash
lsblk -f
```
You may see something like:
```text
NAME FSTYPE FSVER LABEL UUID MOUNTPOINTS
sda
└─sda1 ext4 1.0 Birch bf61b877-bed4-443b-bc60-6ceae1718b2a /media/wm/Birch
sdb
└─sdb1 ext4 1.0 Aperture 12345678-abcd-1234-abcd-123456789abc /media/wm/Aperture
```
The important information is:
```text
LABEL
UUID
FSTYPE
MOUNTPOINTS
```
For Birch:
```text
UUID=bf61b877-bed4-443b-bc60-6ceae1718b2a
```
---
## Using `blkid`
You can also run:
```bash
sudo blkid
```
Example:
```text
/dev/sda1: LABEL="Birch" UUID="bf61b877-bed4-443b-bc60-6ceae1718b2a" TYPE="ext4"
```
Again, the important part is:
```text
UUID="bf61b877-bed4-443b-bc60-6ceae1718b2a"
```
---
# 7. Create a Permanent Mount Point
Let's say we want Birch permanently mounted here:
```text
/mnt/birch
```
Create the directory:
```bash
sudo mkdir -p /mnt/birch
```
If your Linux user should own that mount point:
```bash
sudo chown wm:wm /mnt/birch
```
Now we can configure `/etc/fstab`.
---
# 8. Edit `/etc/fstab`
Before touching `fstab`, making a backup is never a bad idea:
```bash
sudo cp /etc/fstab /etc/fstab.backup
```
Then edit it.
If you're comfortable with `nano`:
```bash
sudo nano /etc/fstab
```
I personally find **Micro** much nicer:
```bash
sudo apt install micro
```
Then:
```bash
sudo micro /etc/fstab
```
Micro uses much more familiar controls:
```text
Ctrl+S Save
Ctrl+Q Quit
Ctrl+Z Undo
Ctrl+Y Redo
```
You can also use `Ctrl` + the arrow keys to jump between words.
---
# 9. Add the External Drive to `/etc/fstab`
For an `ext4` drive, you might add:
```fstab
UUID=bf61b877-bed4-443b-bc60-6ceae1718b2a /mnt/birch ext4 defaults,noatime 0 2
```
Broken down:
| Entry | Meaning |
|---|---|
| `UUID=...` | Identifies the physical filesystem |
| `/mnt/birch` | Where the drive will appear |
| `ext4` | Filesystem type |
| `defaults,noatime` | Mount options |
| `0` | Dump backup setting |
| `2` | Filesystem check order |
Save the file.
Then test it **before rebooting**:
```bash
sudo mount -a
```
If that returns no errors, check:
```bash
findmnt /mnt/birch
```
You should see the drive mounted there.
---
## Optional: Allow Linux to Boot Without the Drive
If the external drive won't always be connected, consider adding:
```text
nofail
```
For example:
```fstab
UUID=bf61b877-bed4-443b-bc60-6ceae1718b2a /mnt/birch ext4 defaults,noatime,nofail 0 2
```
This tells Linux:
> If this drive isn't attached during boot, don't treat that as a fatal problem.
For removable external drives, that's often a very good idea.
---
# 10. NTFS and exFAT Drives
If your external drive uses NTFS or exFAT, the `fstab` configuration will be different because those filesystems don't use normal Linux ownership permissions in quite the same way as `ext4`.
First determine the filesystem:
```bash
lsblk -f
```
You might see:
```text
ntfs
```
or:
```text
exfat
```
For these drives, mount options such as:
```text
uid=1000
gid=1000
```
may be appropriate so your normal Linux account owns files from Linux's perspective.
Find your UID and GID with:
```bash
id
```
Example:
```text
uid=1000(wm) gid=1000(wm)
```
Don't blindly copy an `ext4` `fstab` line for an NTFS or exFAT drive. The filesystem type matters.
---
# 11. Configure Samba
Samba's main configuration file is:
```text
/etc/samba/smb.conf
```
Make a backup:
```bash
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.backup
```
Then open it:
```bash
sudo micro /etc/samba/smb.conf
```
Scroll to the bottom.
---
# 12. Create a Samba Share
Let's share Birch.
Add:
```ini
[Birch]
path = /mnt/birch
browseable = yes
read only = no
guest ok = no
valid users = wm
```
The name in square brackets:
```ini
[Birch]
```
is the **network share name**.
That's the name that will appear on the Mac.
The actual Linux path:
```ini
path = /mnt/birch
```
doesn't have to match it.
---
## What These Settings Mean
```ini
browseable = yes
```
Allows the share to appear when browsing the server.
```ini
read only = no
```
Allows writing as well as reading.
```ini
guest ok = no
```
Requires authentication.
```ini
valid users = wm
```
Only permits the Samba user `wm`.
---
# 13. Sharing Multiple External Drives
This is one of Samba's nicest features.
You can simply add another block.
Suppose you have:
```text
/mnt/birch
```
and:
```text
/mnt/aperture
```
Your Samba configuration could contain:
```ini
[Birch]
path = /mnt/birch
browseable = yes
read only = no
guest ok = no
valid users = wm
[Aperture]
path = /mnt/aperture
browseable = yes
read only = no
guest ok = no
valid users = wm
```
Your Mac will then see two separate network shares:
```text
Birch
Aperture
```
Both can live on the same Linux computer.
```mermaid
flowchart TD
A["Linux Mint"]
B["/mnt/birch"]
C["/mnt/aperture"]
A --> B
A --> C
B --> D["Samba Share: Birch"]
C --> E["Samba Share: Aperture"]
D --> F["Mac Finder"]
E --> F
```
---
# 14. Test Your Samba Configuration
Before restarting anything, run:
```bash
testparm
```
Samba will read your configuration and report syntax errors.
If everything is okay, you'll see something along the lines of:
```text
Loaded services file OK.
```
This command is worth remembering:
```bash
testparm
```
Any time you edit `smb.conf`, run it before going further.
---
# 15. Reload Samba
After changing the Samba configuration:
```bash
sudo systemctl reload smbd
```
Or, if you prefer:
```bash
sudo systemctl restart smbd
```
Then verify:
```bash
systemctl status smbd
```
---
# 16. Allow Samba Through the Linux Firewall
If you're using UFW:
```bash
sudo ufw status
```
If it's active, allow Samba:
```bash
sudo ufw allow Samba
```
Then check:
```bash
sudo ufw status
```
You should see Samba listed among the allowed applications.
There's generally no reason to disable the entire firewall just to make Samba work.
---
# 17. Connect from macOS
On the Mac, open **Finder**.
Press:
```text
⌘ + K
```
This opens **Connect to Server**.
Enter:
```text
smb://192.168.1.71
```
using the IP address of your Linux computer.
You can also connect directly to a specific share:
```text
smb://192.168.1.71/Birch
```
or:
```text
smb://192.168.1.71/Aperture
```
Click **Connect**.
---
# 18. Enter Your Samba Credentials
macOS may ask whether you want to connect as:
```text
Guest
Registered User
```
Choose:
```text
Registered User
```
Then enter your Samba credentials.
For example:
```text
Name: wm
Password: ********
```
The password is whatever you previously created with:
```bash
sudo smbpasswd -a wm
```
You can allow macOS to store the password in Keychain if this is your own trusted network.
---
# 19. The Share Appears in Finder
Once connected, the drive should appear in the Finder sidebar under **Locations**.
For example:
```text
Locations
├── Birch
└── Aperture
```
You can browse it like another filesystem.
The important distinction is that the actual drive is still:
```text
External HDD → Linux
```
Your Mac is accessing it through:
```text
Mac → Network → SMB → Linux → External HDD
```
---
# 20. Changing the Share Name
Suppose this:
```ini
[Birch]
```
becomes:
```ini
[Archive]
```
The physical drive hasn't changed.
Only its Samba share name has.
Run:
```bash
testparm
```
and then:
```bash
sudo systemctl reload smbd
```
Your Mac would now connect using:
```text
smb://192.168.1.71/Archive
```
instead of:
```text
smb://192.168.1.71/Birch
```
You may need to disconnect the old Finder share and reconnect.
---
# 21. Share Names vs. Linux Paths
These are completely separate concepts.
For example:
```ini
[Photography Archive]
path = /mnt/aperture
```
means:
```text
Linux filesystem:
/mnt/aperture
```
but Mac users see:
```text
Photography Archive
```
Personally, I prefer simple share names without spaces:
```ini
[Aperture]
```
or:
```ini
[PhotoArchive]
```
They're easier to type into URLs and scripts.
---
# 22. Linux File Permissions Still Matter
Samba doesn't magically bypass normal Linux filesystem permissions.
If your user cannot access:
```text
/mnt/birch
```
locally, Samba will usually have trouble accessing it too.
Check:
```bash
ls -ld /mnt/birch
```
You might see:
```text
drwxr-xr-x 10 wm wm 4096 Oct 6 18:00 /mnt/birch
```
If `wm` owns the files and directories, that's usually ideal for a single-user home setup.
Be cautious with commands like:
```bash
sudo chown -R wm:wm /mnt/birch
```
The `-R` means **recursive** and will change ownership of everything on the drive.
On a multi-terabyte drive, that can mean millions of files. Don't run it unless you actually intend to change ownership across the entire filesystem.
---
# 23. A Complete Two-Drive Example
Let's imagine this setup:
```text
Linux username:
wm
Linux IP:
192.168.1.71
Drive 1:
Birch
UUID=bf61b877-bed4-443b-bc60-6ceae1718b2a
Drive 2:
Aperture
UUID=12345678-abcd-1234-abcd-123456789abc
```
## `/etc/fstab`
```fstab
UUID=bf61b877-bed4-443b-bc60-6ceae1718b2a /mnt/birch ext4 defaults,noatime,nofail 0 2
UUID=12345678-abcd-1234-abcd-123456789abc /mnt/aperture ext4 defaults,noatime,nofail 0 2
```
Create the mount points:
```bash
sudo mkdir -p /mnt/birch
sudo mkdir -p /mnt/aperture
```
Test:
```bash
sudo mount -a
```
Verify:
```bash
findmnt /mnt/birch
findmnt /mnt/aperture
```
---
## `/etc/samba/smb.conf`
```ini
[Birch]
path = /mnt/birch
browseable = yes
read only = no
guest ok = no
valid users = wm
[Aperture]
path = /mnt/aperture
browseable = yes
read only = no
guest ok = no
valid users = wm
```
Check it:
```bash
testparm
```
Reload Samba:
```bash
sudo systemctl reload smbd
```
Then connect from macOS:
```text
smb://192.168.1.71/Birch
```
and:
```text
smb://192.168.1.71/Aperture
```
---
# 24. Troubleshooting
## Mac Says the Server Cannot Be Found
First see whether the Mac can reach Linux at all.
From macOS Terminal:
```bash
ping 192.168.1.71
```
If that works, check Samba on Linux:
```bash
systemctl status smbd
```
---
## Samba Configuration Error
Run:
```bash
testparm
```
This catches many configuration mistakes immediately.
---
## Authentication Failure
Verify the Samba account exists:
```bash
sudo pdbedit -L
```
If necessary, reset its password:
```bash
sudo smbpasswd wm
```
---
## Drive Exists but Mac Cannot Open It
Check the Linux permissions:
```bash
ls -ld /mnt/birch
```
Then make sure Linux itself can access it:
```bash
ls /mnt/birch
```
If your Linux account can't access the directory, fix that before troubleshooting Samba.
---
## The External Drive Isn't Mounted
Check:
```bash
lsblk -f
```
and:
```bash
findmnt
```
Then test your `fstab`:
```bash
sudo mount -a
```
If `mount -a` produces an error, fix that before troubleshooting Samba.
---
## Samba Works Until Reboot
This is one of the main reasons for using UUID-based `/etc/fstab` entries.
Check:
```bash
findmnt /mnt/birch
```
If the external drive isn't mounted at the location specified by:
```ini
path = /mnt/birch
```
then Samba has nothing there to share.
---
# 25. Useful Commands Cheat Sheet
### Find drives
```bash
lsblk -f
```
### Find UUIDs
```bash
sudo blkid
```
### Find your user ID
```bash
id
```
### Find Linux IP addresses
```bash
ip a
```
### Check mounts
```bash
findmnt
```
### Test `/etc/fstab`
```bash
sudo mount -a
```
### Edit Samba configuration
```bash
sudo micro /etc/samba/smb.conf
```
### Check Samba configuration
```bash
testparm
```
### Restart Samba
```bash
sudo systemctl restart smbd
```
### Reload Samba without a full restart
```bash
sudo systemctl reload smbd
```
### Check Samba status
```bash
systemctl status smbd
```
### Add a Samba user
```bash
sudo smbpasswd -a USERNAME
```
### List Samba users
```bash
sudo pdbedit -L
```
### Allow Samba through UFW
```bash
sudo ufw allow Samba
```
---
# Final Architecture
Once everything is configured, the full chain looks like this:
```mermaid
flowchart TD
A["External HDD"] -->|"UUID"| B["/etc/fstab"]
B --> C["Stable Mount Point<br>/mnt/birch"]
C --> D["Samba<br>/etc/samba/smb.conf"]
D --> E["SMB Share<br>[Birch]"]
E --> F["Home Network"]
F --> G["macOS Finder"]
H["Samba User<br>wm"] --> D
I["SMB Password"] --> H
```
The end result is simple from the Mac's perspective:
```text
Finder
↓
smb://192.168.1.71/Birch
↓
Linux Mint
↓
/mnt/birch
↓
External Hard Drive
```
The configuration work happens once. After that, Linux can function as a straightforward file server while the Mac accesses those drives directly through Finder.