USSSCP — Ubuntu, Samba, Sabnzbd+, Sickbeard, Couchpotato and Plex.

Sebastian
4 min readMay 18, 2016

--

I’m going to show you how to set up an Ubuntu Server installation that will auto-update your media, give you the option to feed it to your TV through Plex, and allow you to view the files through your windows computers in your house. You know… just in case your old-school in-laws come over and want to watch something on their new-fangled personal computer.

This is the first part in a series of tutorials to configure your server to automate your media and serve it to your home devices. Check out the other parts!

  1. Install Ubuntu and Samba. (You’re here)
  2. Install and Configure SABnzbd+
  3. Install and Configure Sickbeard.
  4. Install and Configure Couchpotato.
  5. Install and Configure Plex.
  6. BONUS: Install and Configure Transmission.

Ubuntu

I’m skipping Ubuntu installation. There are many, many, many tutorials that you can follow to get through this part. I would simply suggest that you use an Ubuntu Server version, so that you’re not using part of your processing and RAM to serve up a GUI that you’ll likely not use often enough.

I also suggest that you install Ubuntu to its own drive, however this step is completely not necessary, and is really only beneficial if you plan on upgrading your storage space for media in the future.

Samba

Once you’ve installed Ubuntu, make sure that you install Samba. We’re going to set it up so that anyone in your network can access certain files, and also set up a different share for your own, personal, files.

Part 1: Public Share

Note: Let’s get into a bash instance so that we can do all these commands without having to type “sudo” each time.

sudo bashapt-get install samba samba-common python-glade2 system-config-samba

This will install Samba with all of its typical dependencies.

Once that’s done, let’s configure the /etc/samba/smb.conf file. Make a backup of it by entering the following

mv /etc/samba/smb.conf /etc/samba/smb.conf.bak

Then let’s actually modify the smb.conf file.

nano /etc/samba/smb.conf

Enter the following

[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
dns proxy = no
#====================== Share Definitions =========================
[Media]
path = /media/plex
browsable =yes
writable = yes
guest ok = yes
read only = no

The path = /media/plex and [Media] can be anything you’d like. I usually use [Media] for the name of the share, and /media/plex for the path. This makes it easy to remember where it is, since /media is a common path in Linux.

Now let’s create the directories that we’ll be needing for these shares. In this case, we just need to create the /plex directory in the /media directory.

mkdir -p /media/plex

Then restart Samba

service smbd restart

You should now be able to access your Samba share through your windows machine by typing the Ubuntu server name in the run window.

Type the name of your server in the run window to open an explorer window with the new samba share you created.

Now, you will notice if you try to create a file that you will have a problem. Windows will tell you that you don’t have permission and will get an error. Go ahead. Try it. I’ll wait.

Let’s fix that, shall we?

Check the permissions of the shared folder.

root@ubuntu:~# ls -l /media
total 8
drwxr-xr-x 2 root root 4096 May 17 13:35 cdrom
drwxr-xr-x 2 root root 4096 May 17 13:35 plex

In order for anyone to access the plex folder, we need to change the user and group from root:root to nobody:nogroup.

chmod -R 0755 plex/
chown -R nobody:nogroup plex/

We should get something like this

root@ubuntu:~# ls -l /media
total 8
drwxr-xr-x 2 root root 4096 May 17 13:35 cdrom
drwxr-xr-x 5 nobody nogroup 4096 May 17 17:16 plex

You should now be able to browse and create files in the plex directory through Windows.

Part 2: Secure Share

We now need to create a user and group to access the private share with the right authentication.

addgroup justiceleagueadduser batman --ingroup justiceleaguesmbpasswd -a batmanroot@ubuntu:~# smbpasswd -a batman
New SMB password:
Retype new SMB password:
Added user batman.

Now we need to create a new folder for the private share.

mkdir -p /media/batcave
cd /media
chmod -R 0770 batcave/

Then we need to edit the configuration file again.

nano /etc/samba/smb.conf[batcave]
path = /media/batcave
valid users = @justiceleague
guest ok = no
writeable = yes
browsable = yes

Finally, we need to restart the samba service again.

service smbd restart

Now you can connect to your new private share with the username and password you just created.

However, you’ll notice that you still can’t create files in this share. That’s because we need to give access to the the user and group we just created. After all, Batman can’t have his top secret files just floating around for anyone to open all willy nilly.

cd /media
chown -R batman:justiceleague batcave

Congrats! You have a samba share for your media, and another for your private antics.

--

--

Sebastian

Video Gamer, Movie Lover, Podcast Enthusiast, Amateur Graphic Designer. I spend my free time making #tshirts, #GoPro videos, and other #artwork. Go Hotspurs!