How to Configure Samba in CentOS 6.4/Linux

Samba Server Configuration in CentOS or Linux :

To Configure the samba in the Linux Server or in CentOS, you need to perform certain configurations in the linux server. So follow the steps which was given below to configure the ftp server in the CentOS or in any other linux server.


Step 1: Install Samba Packages

As the first step use the below command to install the samba sevices.

yum install samba samba-commons cups-libs

Step 2: Configure Samba Service

The use the below command to make the samba services on at the startup.

chkconfig smb on
chkconfig nmb on

Step 3: Restart Samba Services

Then restart the samba services using the below command.

service smb restart
service nmb restart

Step 4: Configure smb.conf file

Enter the below setting in the smb.conf file which was situated in the samba folder in etc folder.

#============ Global Settings==================#

workgroup = WORKGROUP
security = share

#============ Share Definitions =================#

path = /samba/share
valid users = @smbgrp
guest ok = no
writable = yes
browsable = yes

Step 5: Configure Samba Users

Create the samba users and samba group.

useradd smbuser
groupadd smbgrp

Step 6: Add User to Samba Group & set samba Share Password

Add the users to the samba group and set the samba password for the user.

usermod -a -G smbgrp smbuser
smbpasswd -a smbuser

Step 7: Create Share folder and Set Permissions for Samba Users

Create a share folder and give the permissions for the samba group

cd /samba/
mkdir share
chown -R smbuser:smbgrp share/
chmod -R 0770 share/

Step 8: Disable SELinux and Add Firewall rules

Configure the selinux for the samba services.

vi /etc/selinux/config

Set SELINUX to Disabled :


Add Firewall Rules :

use the below command to allow the mentioned ports through the linux firewall.

iptables -I INPUT 4 -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
iptables -I INPUT 5 -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
iptables -I INPUT 6 -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
service iptables save

Step 9 : After finishing all the above configurations restart the samba services

Then as the final step restart the samba services.

service smb restart
service nmb restart

You can also enable the selinux but you need to change the permission for the samba services in selinux.

You may also like...

2 Responses

  1. I’ve been surfing online more than three hours today, yet I by no means found any interesting article like yours.

    It is pretty price sufficient for me. In my view, if all web owners and
    bloggers made just right content material as you probably did, the internet can be a lot more helpful than ever before.

  2. VonnieNUpham says:

    Nice post. I had been checking continuously this weblog and I’m inspired!
    Very useful information specifically the closing part :) I handle
    such information much. I used to be looking
    for this certain information to get a very long time.
    Thanks and better of luck.

Leave a Reply

Your email address will not be published. Required fields are marked *