Monday, December 29, 2014

pcDuino3 Nano - Installing, Setting Up and Testing Samba via Webmin

This is another in the series documenting my setup of a new home server with the Linksprite pcDuino3 Nano.  A listing for the entire series can be found here.  More information on the pcDuino3 Nano can be found at Linksprite’s website and the pcDuino website.

The first step in setting up my home server was to install and configure Samba.

These steps start with installing Samba using Webmin and configure the network for Windows.  From there they create a user, group, add the user to Samba, create a share and set protections on the share so that anyone in the group can access and create files on the share.

I am by no means a Samba expert.  I ran through the steps several times but that doesn’t mean that there could not be problems with them.  If something doesn’t work for you as shown below leave a comment and I will try and figure out what is wrong.

The final configuration for the home server will have the shares on a separate partition from the root file system.  These basic instructions create a testshare on the root drive.  I will build on them in a later post for the final setup.

This is part of my pcDuino3 Nano series of posts but it should work for webmin on other systems.

Install SAMBA from Webmin

From the Webmin menu select Un-unsed Modules (1) and scroll down and select Samba Windows File Sharing (2)

image

You will get a message that the samba server executable was not found and will be asked if you want to install samba. Click on the link to install samba.

image

Select “Click Here” to install and samba will be installed.

image

Now under Servers you will have a Samba Windows File Sharing selection.

image

Configure Network

From the Webmin menu open Networking (1) and select Network Configuration (2) and then select Hostname and DNS Client (3).

image

Here you can setup a name for your server (1), set your DNS Servef (2), change the resolution order to DNS (3) and the Hosts file and press Save (4).

image

After save on the next web page select Apply Configuratio (1)

image

Now go back under Servers to Samba Windows File Sharing and select Windows Networking.

image

Enter your workgroup and server name.

image

Create a User

From the Webmin menu open System (1), select Users and Groups (2) and select Create a new user (3).

image

Enter a username (1), the user’s real name (2), set the shell as preferred (3), set a password (4), create or put the user in an existing group (5), add secondary groups of users and ssh (6) and then press Create (7)

image

You should now see your user in the user list.

image

Add the User to Samba

Go back to Servers (1), select Samba Windows File Sharing (2) and under Samba Users select Convert Users (3).

image

I would suggest changing the default settings to Yes  for deleting unix users that no longer exist and to lock accounts for newly created users.

image

After you select Create Users your users will be created.

image

From back on the share list screen under Samba Users if you select Samba Users (1) you should see the user you created.

image

Select that user (1).

image

Update the users password (1) and select Save (2).

image

Creating a File Share

Go back to Servers (1), select Samba Windows File Sharing (2) and under at the top of the page select Create a new file share (3).

image

Enter a Share name (1), the directory that will be chard (2), the create permissions (3) and the group (4).  For this share I plan to use a group and put all the users who should have access to these files in that group.  As a result I setup the permissions on the directory to be 770 so group and owner have complete access but other has none.  Select Create (5) to create the share.

image

Your new share will show up in the share list at the top of the Samba Windows File Sharing page.  Select the share (1).

image

First you want to select Security and Access Control (2).

image

On the Edit Security page you will need to set Limit to possible list (1) and then add the group under Possible Groups (2) and Read / Write Groups (3).  Then select Save (4).

image

This will return you to the Edit File Share page where you now want to select File Permissions (2).  On the Edit File Permissions page you want to set New Unix file (1) and directory mode (2) to 770 and force the unix group to your group in this case testgroup (3).  Then force Unit file (4) and directory mode (5) to 0770 and 770 respectively and select Save (6).  This will result in files being owned by the user who created them and by the testgroup.  Also, other will have no access to files on the share.

image

Go back to the main Samba Windows File Sharing page and Restart the Samba Server.

image

You now should have a file share that you can map to from the user you created with the password you set in Samba which is different that the logon password.  When you connect to the share using that username and password you should be able to save files to it.

4 comments:

Unknown said...

Great manual! Thank you very much.

Anonymous said...

This is absolutely fantastic post, you have just saved me from limiting my marks, followed the instructions , used cd home and later use testparm and ls and ls -1 , it all work pretty cool . Thanks once again, do post more. Gracias

kiki7x said...

thank you brow

leonardo alejandro nissensohn said...

great post after centos 7 put down system-config-samba for security reasons, this post its the secure way