Samba (SMB) Server Setup for Media Server

Published on August 2, 2022 at 5:26 pm by LEW

Introduction

In this post we will add an instance of SAMBA to our media server, making it detectable by the SMB/CIFS protocol common on Windows based computers.

Doing this will allow file sharing across the local area network (LAN) in the same manner that Windows file sharing works. You will be able to mount your media server to a drive letter and open it in file explorer.

While there are better networking protocols out there, SMB has the advantage that pretty much everyone can use it.

Boring History Stuff

Server message Block (SMB) was a protocol introduced by IBM back in the 1980’s, and it provided shared file and printer access across a network of computers running OS/2. SMB originally used the NetBIOS protocol. When Microsoft introduced SMB in NT 3.1, they used the TPC/IP protocol.

In the 1990’s Microsoft published a modified SMB with a new name, Common Internet File System (CIFS). A newer updated version of SMB/CIFS (SMB 2) was released in 2006 with Windows Vista and Windows Server 2008.

Apple migrated from Apple Filing Protocol to SMB2 with OS X 10.9. Samba (a SMB client/server) was introduced to the Unix/Linux environment in the 1990’s.

Installation

The nice thing about installing SAMBA on Debian is that it comes pretty much per-configured for our use case. Of course like always, to install programs on Debian you must have sudo access or be root. Also, like always, it is a good idea to update before installing with apt update and apt upgrade.

We will be installing three packages; samba, smbclient, and cifs-utils. The command to install these looks like this.

apt install samba smbclient cifs-utils

Global Settings

For our use case we want to be able to upload files to the minidlna user home directory on our LAN. So we are not going to bother with public/private access.

Note that how we access our media server through SMB will depend on how our client (Windows) is setup.

For our use case we want to open and scroll through the /etc/samba/smb.conf file. We want to scroll down to the [homes] section of the file. Basic home directory access should already be setup, but we want to change a few things. Specifically we want to set browseable to yes, and read only to no. This will allow us to browse the home folder and write files to it. After making the changes, save and exit.

Next we want to setup a samba user. The samba user is different form the Linux user. However we are going to use the same name and password, to keep things simple. We type the command smbpasswd minidlna (minidlna is our media account we created in a previous post). We will be asked for a password, enter the one we selected for this account.

And that should be it, we should be done.

Logging in from a SMB Client

Note I am going to assume Windows 10 here.

Open file explorer, and right click on This PC. From the menu select Map Network Drive…

Select an unused drive letter, then for the folder enter the IP address and user name. From the previous posts I enter the following.

	\\192.168.10.10\minidlna

You should initially be asked for a user name and password. Once you enter these you will be logged into the home folder for minidlna, and it will be opened in file explorer.

Depending on how Windows network sharing/discovery is setup you may be able to use the server name instead of the IP address.

Or you can add the IP Address and server name to C:\Windows\System32\drives\etc\hosts, and log in with the server name.

Conclusion

In this post we set up a SMB server on our media server using the samba program. We basically used the default values for logging into a home directory. This facilitates much easier file sharing once the server is mapped to a drive letter in Windows.

Note that we have only scratched the surface of samba. It is a full SMB server, and has similar capabilities as Windows Server when it comes to file sharing.

Part 1 Media Servers and Clients

Part 2 Universal Plug and Play (UPnP) Server

Part 3 Using Secure Copy Protocol (scp) on a Server

Part 4 File Transfer Protocol (FTP) Server Build

Part 5 Samba (SMB) Server Setup for Media Server

Part 6 Kodi Media Client setup

Add New Comment

Your email address will not be published. Required fields are marked *