Introduction: How to Setup Samba (file Server)

This Instructable will guide you through configuring Samba

This Instructable is based on Linux Ubuntu 9.04. The instructions on setting it up with newer versions will be pretty much identical

I will focus on just setting up a file server in this Instructable, although Samba can be expanded to run as an Active Domain Controller for Windows and a lot more

Step 1: Background on Samba

Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients. Samba is freely available, unlike other SMB/CIFS implementations, and allows for interoperability between Linux/Unix servers and Windows-based clients.

Samba-3 by Example explains further, saying:

Samba is software that can be run on a platform other than Microsoft Windows, for example, UNIX, Linux, IBM System 390, OpenVMS, and other operating systems. Samba uses the TCP/IP protocol that is installed on the host server. When correctly configured, it allows that host to interact with a Microsoft Windows client or server as if it is a Windows file and print server.

From The Official Samba HOWTO:

The goal behind the project is one of removing barriers to interoperability.

Samba is a software package that gives network administrators flexibility and freedom in terms of setup, configuration, and choice of systems and equipment. Because of all that it offers, Samba has grown in popularity, and continues to do so, every year since its release in 1992.

For more details on Samba or SMB, see:

Intro to Samba
SMB/CIFS Links

Step 2: Let's Start!

First download and install the newest version of Ubuntu

Run update manager to update Ubuntu

To get Samba open terminal and run sudo apt-get install samba

Step 3: Configure Samba

Type sudo gedit /etc/samba/smb.conf in terminal to open and edit Samba's configuration file.

  • Scroll down to Global Settings in the .conf file

Change WORKGROUP to whatever you want your workgroup to be.

Add netbios name = server and replace server with whatever you want the servers name to be

  • Scroll down to Share Definitions in the .conf file

Change yes next to read-only to no if you want to be able to write to that drive

Change %S next to valid users to the users you want to be able to access this drive (we will add users to the system in the next step)

Un-comment the options there ([homes], comment, browseable, read only and valid users) by removing the ; in front of them

If you want to add more drives just repeat those options e.g.

[public]
comment = Data
path = /export
force user = thermoelectric
force group = users
read only = No

Path is where that shared drive is located.

Step 4: Adding Users to Samba

Add users to Ubuntu by typing this into terminal e.g
sudo useradd -c "Thermoelectric Rules" -m -g users -p password Thermoelectric

You replace password with that users password. You replace Thermoelectric Rules with your real name. You replace Thermoelectric with your user name.

Repeat that until you have made a account for all of your users

Then add the users to Samba by typing this into terminal e.g
sudo smbpasswd -a Thermoelectric
Replace Thermoelectric with your user name

Repeat until you have added all your users to Samba

Step 5: Start and Test Samba

Start Samba by executing this in terminal
sudo nmbd; smbd;

Configure the /export directory:
sudo mkdir /export
sudo chown Thermoelectric.users /export
sudo chmod u=rwx,g=rwx,o-rwx /export

Check that Samba is running correctly:

sudo smbclient -L localhost -U%

Connect to SERVER (netbios name) as Thermoelectric (your user name):

sudo smbclient //SERVER/Thermoelectric -UThermoelectric%password

Step 6: Finish!

I hope you enjoyed this Instructable.

If you experience any errors while installing and using Samba, I will be glad to help.

Have you succeeded installing and using Samba? If so comment!

Is there anything you think I need to add to this Instructable? Comment and tell me!

Thanks. Please comment and rate

Comments

author
corrysoccer16 (author)2010-05-06

Ok, Hi I am new at this and I can work through the steps after installation of Samba(since you did a good job of explaining it) but the problem is installing it I have no idea how to do it.  I have only worked with Windows and not Linux so can anyone help me with installing Samba?

author

 The first step is based on installing it. What Linux distro are you using?

author
demodraco (author)2009-08-10

what do you do if global settings and everything else that should be in the configuration file is not there???

author
thermoelectric (author)demodraco2009-08-10

What? Is the configuration file blank? Hmm. You might be able to download anotherone of the net somewhere...

author

Spelling Error: of - off

Hydro

author

One letter. Big deal

author
Hydroelectric (author)2009-09-28

Hey Thermo, Great instructable, and I'm going to set it up tomorrow. In steps 5 and 6, you should have put some sort of picture. Apart from that, great instructable. Hydroelectric

About This Instructable

32,966views

29favorites

License:

Bio: I am a high school student in Cairns, Queensland. Most of the time I am either at school, sleeping, doing stuff on my computer, making ... More »
More by thermoelectric:The Geek Group - 2010 Air Raid Siren DemoThe Geek Group - CNC RevolutionBallistic Bird Feeding (The Geek Group)
Add instructable to: