Notice: Undefined index: order_next_posts in /nas/content/live/gadgetmag/wp-content/plugins/smart-scroll-posts/smart-scroll-posts.php on line 194

Notice: Undefined index: post_link_target in /nas/content/live/gadgetmag/wp-content/plugins/smart-scroll-posts/smart-scroll-posts.php on line 195

Notice: Undefined index: posts_featured_size in /nas/content/live/gadgetmag/wp-content/plugins/smart-scroll-posts/smart-scroll-posts.php on line 196

Build a Samba file server

How to build your own file server using Samba and Ubuntu with help from Linux User & Developer veteran, Sukrit Dhandhania…

This article originally appeared in issue 89 of Linux User & Developer magazine. Subscribe and save more than 30% and receive our exclusive money back guarantee – click here to find out more.

Samba is a Linux/UNIX software package that allows you to share files and directories with computers running other operating systems over the network. It also allows your Linux desktop or laptop to sign into a Windows network and be able to share files inside a workgroup. There are several advanced features that Samba comes with, such as domain controller. We will look at how to convert your Ubuntu box into a Samba file server and configure it to share directories with different combinations of permissions.

01 Prerequisites
When setting up a Linux file server, there are certain things that you will to have set up on your server before you start working on the Samba bit. The first thing you want to do is to set up the server with a static IP address, as opposed to one assigned dynamically by a DHCP server. Edit the file ‘/etc/network/interfaces’ with root user privileges and set the IP address manually. An example of the settings would be using something like the following:
[sourcecode language=”bash”]auto eth1
iface eth1 inet static
Using a static IP for any type of server makes good sense. Save the changes and restart the network with the command ‘# sudo /etc/init.d/networking restart’.

02 Installing Samba
Distributions such as Ubuntu have made the installation of just about anything so simple and straightforward with smart package management that you can have pretty much any software installed with a one-line command. To install Samba on your Ubuntu computer, execute the following:
[sourcecode language=”bash”]# sudo apt-get update
# sudo apt-get install libcupsys2 samba samba-common[/sourcecode]
Here we are requesting Ubuntu to install three packages. The first one is to share your printer, the other two are Samba and its support packages.

03 Configuration file
The configuration files of Samba are stored in the ‘/etc/samba/’ directory. The first thing you should do before we dive into the configuration of Samba is to make a backup of the main configuration file.
[sourcecode language=”bash”]# cp /etc/samba/smb.conf /etc/samba/smb.conf.bak[/sourcecode]
Now open the file with your favourite text editor and let’s make some configuration changes:
[sourcecode language=”bash”]# sudo vim /etc/samba/smb.conf[/sourcecode]
Next Page
[twitter username=”linuxusermag”]