Featured image of post Master the Basics - SMB Guide for Media Servers

Master the Basics - SMB Guide for Media Servers

Install, configure, and run SMB like you own the network (because you do).

You’ve got files. You’ve got machines. And you’re tired of playing sneakernet with USB sticks like some kind of caveman.

What you want is simple: a shared folder that every device on your network can see. Windows boxes. Macs. That crusty ThinkPad running Ubuntu in the corner. Even your “smart” TV that somehow needs to stream 4K remuxes but can’t figure out basic networking.

Enter Samba. It’s your network’s Swiss Army knife, part bouncer, part bartender, part DJ. And once you set it up right, it just works.

💭 TL;DR
Samba turns your Linux box into a file server that every device on your network can actually use. We'll skip the garbage defaults and build something that streams 4K without stuttering and doesn't require a PhD to troubleshoot.
UGREEN NASync DXP4800 Plus 4-Bay Desktop NAS

UGREEN NASync DXP4800 Plus 4-Bay Desktop NAS UGREEN NASync DXP4800, 4-Bay NAS with Intel N100 Quad-Core CPU (Up to 3.4GHz) 8GB DDR5, 2x M.2 PCIe Slots and a 2.5GbE Port (Diskless). This is perfect if you don’t want to DIY your NAS.

Contains affiliate links. I may earn a commission at no cost to you.

When SMB Is Your Best Friend

SMB shines in these scenarios:

  • Mixed OS chaos: Windows, macOS, Linux all playing nice together. No more “sorry, your OS isn’t supported.”
  • Apps that demand SMB: Time Machine backups. Windows Explorer mapping. Kodi libraries. Sonos music folders. They speak SMB or they speak nothing.
  • User-based security: You decide who gets in and what they can touch. No more “everyone has access to everything” nonsense.
  • Dumb devices: Your smart TV, IoT gadgets, and network printers don’t know NFS from a hole in the ground. But they know SMB.
  • Cross-platform development: Same project folder on Windows, Mac, and Linux. No sync conflicts, no version hell.

Skip SMB When…

  • Linux-only network: NFS is faster, simpler, and doesn’t carry Windows baggage.
  • Remote access: SSHFS or WebDAV won’t make you cry when you’re connecting over WAN.

Install Samba (Debian/Ubuntu)

Install the samba package:

sudo apt update && sudo apt install samba

That’s it. No package maze, no dependency hell.

Now set the Samba user’s password. This is not optional:

sudo smbpasswd -a yourusername
⚠️
Warning: Why this matters: Samba uses its own password database. Your Linux user exists? Great. But without smbpasswd, you’re locked out. I’ve watched too many people bang their head against “authentication failed” errors because they skipped this step.

Start the services:

sudo systemctl enable --now smbd nmbd

Configuration File That Actually Works

Time to ditch the ancient defaults in /etc/samba/smb.conf. Here’s what you actually need.

[global] Settings: With Large File Transfers and Security in Mind

[global]
  workgroup = WORKGROUP
  netbios name = MEDIA-SERVER
  server string = %h server (Samba %v)
  
  # Security that makes sense
  security = user
  map to guest = Bad User
  
  # Force modern protocols
  server min protocol = SMB2
  server max protocol = SMB3
  client min protocol = SMB2
  
  # Encrypt everything
  smb encrypt = required

  # Disable insecure features
  lanman auth = no
  ntlm auth = no

  # Kill anonymous access
  restrict anonymous = 2

  # Network optimizations
  socket options = TCP_NODELAY SO_RCVBUF=131072 SO_SNDBUF=131072

  # File transfer optimization
  use sendfile = yes

  # Async I/O for large files
  aio read size = 16384
  aio write size = 16384

  # Reduce metadata overhead
  strict allocate = yes
  
  # Logging that helps
  log file = /var/log/samba/log.%m
  max log size = 1000
  
  # Stop being a DNS server
  dns proxy = no

Why these settings work:

  • security = user: Per-user authentication. Not “everyone’s admin” madness.
  • map to guest = Bad User: Invalid usernames become guest access (if you allow it).
  • server min/max protocol: Forces SMB2/3, ditches the security nightmare that is SMB1.
  • dns proxy = no: Samba shouldn’t handle DNS. That’s your DNS server’s job.
  • smb encrypt = required: All traffic encrypted. No plaintext passwords floating around.
  • restrict anonymous = 2: Kills guest browsing and anonymous enumeration.
  • lanman/ntlm auth = no: Forces modern authentication methods.

[share] Definition: Where the Magic Happens

[media]
  path = /media/storage
  browseable = yes
  read only = no
  guest ok = no
  valid users = yourusername
  force user = yourusername
  create mask = 0660
  directory mask = 0770

Why this configuration works:

  • force user/group: Every file gets the same owner. No more permission spaghetti.
  • create/directory mask: Sane default permissions. Files get 660, directories get 770.
  • browseable = yes: Shows up in Windows Network Explorer without extra clicking.
  • guest ok = no: Authentication required. Because security matters.
TP-Link 2.5GB PCIe Network Card (TX201)

TP-Link 2.5GB PCIe Network Card (TX201) Plug-and-play 2.5GbE PCIe card that unlocks multi-gig speeds for about $30. Works out of the box with Proxmox, Linux, and Windows. No drama—just faster transfers.

Contains affiliate links. I may earn a commission at no cost to you.

Troubleshooting: Fix the Usual Suspects

Check your configuration:

sudo testparm

Test shares without leaving the server:

smbclient -L localhost -U yourusername

Check Samba’s view of connected users:

sudo smbstatus

Watch logs live:

tail -f /var/log/samba/log.smbd

Flush config changes without a reboot:

sudo systemctl restart smbd nmbd

Common Problems, Fast Fixes

“Access denied” but login works:

  • Check Linux filesystem permissions
  • Verify valid users matches actual usernames

Share invisible in Windows:

  • Add netbios name to [global]
  • Restart both services: sudo systemctl restart smbd nmbd
  • Windows sometimes caches old network info. Reboot the client.

Slow transfers:

  • Enable use sendfile = yes
  • Check your network. Gigabit wired > WiFi > carrier pigeon
  • Large files? Enable async I/O settings above

“Mount error: Protocol not supported”:

  • Client trying to use SMB1
  • Fix: mount -t cifs //server/share /mnt -o vers=3.0

The Nuclear Option:

When nothing else works: Stop samba:

sudo systemctl stop smbd nmbd

Remove samba’s cache files:

sudo rm /var/cache/samba/*

Start samba

sudo systemctl start smbd nmbd

Real-World Scenarios

  • Media Server Hub:

    Point Jellyfin, Plex, or Kodi at your SMB share. Works across containers, VMs, and bare metal. One library, every device.

  • Development Folder

    Same codebase accessible from your Windows IDE, Mac laptop, and Linux server. No git commits just to move files around.

  • Backup Target

    Time Machine over SMB. Veeam backups. Even rsync via mounted shares. Central storage that everything can hit.

  • Cheap NAS Alternative

    Old PC + big drives + Samba = network storage that doesn’t cost $800.


SMB vs. The Alternatives

Feature SMB NFS SSHFS
Windows native
macOS native
Performance (LAN) Good Excellent Okay
Security over WAN
Setup complexity Medium Low High
Device compatibility Excellent Poor Poor

The verdict:

  • SMB wins on compatibility.
  • NFS wins on pure speed.
  • SSHFS wins on security.

Pick your poison based on what matters most.

The mac Update That Broke Everything

Client calls at 5 PM. “My media server just died.” Nothing changed on his end except a macOS update.

The culprit? Apple dropped SMB1 support. His Samba config was still allowing the old protocol, and macOS decided it wasn’t secure enough anymore.

One line in /etc/samba/smb.conf:

server min protocol = SMB2

Five minutes later, his movie night was back on track.

Lesson learned: Always set your protocol minimums. Let the OS updates come. You’ll be ready.

The Bottom Line

Samba isn’t sexy. It’s not the hot new container orchestration platform. It doesn’t have a JavaScript framework named after it.

But it works. It connects everything to everything else. And once you configure it right, it fades into the background and just does its job.

That’s the best kind of technology.

Your Network, Your Rules

Stop wrestling with cloud sync conflicts and USB cable hell. Set up a proper SMB share. Stream your movies without stuttering. Back up your machines to something you control.

Because when you run your own file server, you’re not just sharing files, you’re taking back control of your data. And that’s worth the thirty minutes it takes to get Samba running right.

Ready to build something that works? Start with the basic config above, test it with one device, then expand from there. Your future self will thank you when everything just connects.

Seagate Barracuda 24TB Internal Hard Drive

Seagate Barracuda 24TB Internal Hard Drive

Contains affiliate links. I may earn a commission at no cost to you.

© 2024 - 2025 DiyMediaServer

Buy Me a Coffee

Built with Hugo
Using a modified Theme Stack designed by Jimmy