The platform for this assignment varies a little. It was started at the campus using a comp with these specs, and carried on with my home PC.
The virtual environment, i.e. the virtual machines were exported and imported to a USB-stick, which allowed the handy usage of the virtual machine(s).


  • Install a new machine, running Ubuntu Server, to the virtual environment. Install the Samba server and the SSH-server to this machine.
  • Install a new machine, running Windows 7, to the virtual environment.
    (unfortunately I was unable to transfer the Windows machine within the USB-stick, the time it took to export this machine was measured in hours, and I really did not have the time or the patience to wait for this.)
  • Using the Ubuntu Server Guide and the Samba-HOWTO-collection, test and configure the Samba server. Do not setup a printing server, only the file server.
  • Setup disk quotas for the users, i.e. give them Samba -server accounts.

Step 1. Installing the new machine

Firstly, I installed the new Ubuntu Server machine. During installation I selected the Samba server and Open-SSH server to be included in the installation. After the installation was completed I proceeded in configuring the Samba server.

I also installed a new Linux desktop to the environment, running Kubuntu 14.04 LTS, to kind of replace the Windows desktop.

Step 2. Configuring the Samba server

Telling Samba what to do is rather simple. The configurations will change during the setup progress, since I’m proceeding in a step by step manner.

First we need to edit some key/value pairs in the Samba-configuration file. It can be accessed using this command:

sudo nano /etc/samba/smb.conf

Here we will want to look into the [global] -section first. We will need to give our workgroup a name, and give a basic security declaration. My conf-file’s [global] looks like this: globalconf

Next I created a new section to the bottom of the conf-file called “[share]”. This section will define the sharing policies of the file server. You might want to add these lines to it:

comment = Samba File Server #just a friendly reminder
path = /srv/samba/share #we will create this later
browsable = yes
guest only = yes
read only = no
create mask = 0755

My section looks similar to the one above:

Now Samba is configured.

We will now need to create the shared directory, so run these command:

sudo mkdir -p /srv/samba/share
sudo chown exmpl.nogrp /srv/samba/share/

Samba needs to be restarted in order for the configurations to apply:

sudo restart smbd
sudo restart nmbd

You can also run a command “testparm” to check if the configuration file syntax is correct.


There you go. Local network configuration is done!
Your machines in your local network should now detect the Samba file server.

Step 2. Detecting the server

This really isn’t a step at all. Just log into one of your desktops, also connected to the internal network and go check the “Network” (if debian) folder.
In my Kubuntu, I could find the “Samba Shares” folder without any further configurations. Clicked it and:
I can find a few shared networks here, since other people were doing the same stuff in the same network. I could find my network “Example.lan” on the top.
Two folders here, “data” and “share”. We just created the “share” folder. And I also made a text-file there on the server machine, for testing purposes.
Looks like it works!

If you have problems accessing the folders, you might not have permission to them. Try checking the [share] settings. If that doesn’t work, try using chmod to see if the problem is there.

sudo chmod -c -rwxrwxrwx /share

This of course is not very good considering data security, but we just want to see if this is the problem.

Step 3. Users

Users need both accounts on the server and accounts in Samba. So create the users into your server machine. After that let’s make them in Samba as well.

Users are already created in the server, they are valid Samba users. So we only need to give them Samba specific passwords. That is done with the command:

sudo smbpasswd -a user

This how it will look in the terminal:
As we can see here, Samba really doesn’t appreciate my security settings. I also ran into this while checking the Samba status with:


Now this is how it looked. (the server is not working properly yet, we’re on it)

I brute forced this error out, no one likes error:
Messy work around, but it does the job for now. The status looks much better now too:

Let’s see if we can log into our Samba server.
Root login:

sudo smbclient //

If you want to log in with a account is is done with this command:

smbclient // U-usrname/pw


Server status

We can check the server status using this command:

smbclient -l samba -u%


Looks alright.

The users have now been created and the server configured. The next step is to mess around with disk quotas.

Step 4. Disk quotas

Let’s set up disk quotas for our users.  Install the software using this command:

sudo apt-get install quota

After installation take a copy of the conf -file located: /etc/fstab. After open the conf -file.

sudo nano /etc/fstab

By default the file looks as follows:
Add ,usrquota after the errors=remount,ro -part. Don’t remove anything. This file is extremely picky with the syntax.
The modified file will look something like this:

Run a remount to apply the settings:

sudo mount -o remount /

Now, be sure to have your quota turned off before running the check commands. Execute the commands as follows:

sudo quotaoff /
sudo quotacheck -cum /
sudo quotaon /

Now we can set quotas for our users using the sudo edquota

sudo edquota juhotest

We can set the usable disk space etc here. Like this:

After we’ve set quotas as wanted we can see if they are applying. Checking for user quotas can be done with the command:

quota userhere


And there we have it!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s