Samba is an open source and most popular widely used program that enables end users to access Linux shared directory from any windows machine on the same network. Samba is also named as a network file system and can be installed on Linux/Unix operating systems. Samba itself is a client/server protocol of SMB ( Server Message Block) and CIFS (Common Internet File System). Using windows smbclient (GUI) or file explorer, end users can connect to Samba server from any windows workstations to access shared files and printers.

Samba Server Setup

This tutorial explains how to setup Samba Server (fileserver) Using tdbsam Backend on RHEL 6.3/6.2/6.1/6/5.8, CentOS 6.3/6.2/6.1/6/5.8 and Fedora 17,16,15,14,13,12 systems and also we will learn how to configure it to share files over the network using SMB protocol, as well as we will see how to create and add system users on samba user’s database.

1. Preliminary Note

We are using RHEL 6.3 system with hostname tecmint with IP address 172.16.25.126.

2. Disable SELinux

First, check whether SELinux is currently enabled or disabled with following command.

# selinuxenabled && echo enabled || echo disabled
enabled

In our case, SELinux is currently enabled, so we need to disabled it under RHEL/CentOS/Fedora systems, open file called /etc/selinux/config with your choice of editor. ( Ignore this step, if SELinux is already disabled ).

# vi /etc/selinux/config

And change the line that says SELINUX=enabled to SELINUX=disabled and reboot the system.

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted

3. Rebooting System

Here, we will need to reboot the system to re-lable entire file system in the boot process. This reboot process can take some time, depends on the volume of files.

# init 6

Once the system comes to login prompt, login with root user and start installing Samba package.

11. Login to Samba Server from Windows

Now try to login from your Windows system, open Windows Explorer and type the address \\172.16.25.126\tecmint and enter username as tecmint and password, you will see tecmint’s home directory. Refer screenshot below.

Samba Share on Windows

Now to share Samba shared directory type address as \\172.16.25.126\tecmintusers. You will see similar to below.

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.