Build samba server in Fedora/Centos

Samba is a free software re-implementation of SMB/CIFS networking protocol. as of version 3, Samba provides file and print services for various Microsoft Windows clients and can integrate with a Windows Server domain, either as a Primary Domain Controller (PDC) or as a domain member. It can also be part of an Active Directory domain.

Samba runs on most Unix and Unix-like systems, such as Linux, Solaris, AIX and the BSD variants, including Apple’s Mac OS X Server . Samba is standard on nearly all distributions of Linux and is commonly included as a basic system service on other Unix-based operating systems as well. Samba is released under the GNU General Public License. The name Samba comes from SMB (Server Message Block), the name of the standard protocol used by the Microsoft Windows network file system.

So lets  start :

1- Install  packges  needed  for  samba  server

# yum install cups-libs samba samba-common -y

2- make  Samba  starting and  make it  starting  with  boot   linux


#chkconfig --levels 235 smb on

Now start samba server

#/etc/init.d/smb start


3-Make  directories  of  samba  share  and  give  the  ownership   (you  can  make  other  name  directories)

# mkdir -p /home/sambashares/allusers


# chown -R root:users /home/sambashares/allusers


# chmod -R ug+rwx,o+rx-w  /home/sambashares/allusers


4-Edit   the  configuration :

# vi /etc/samba/smb.conf

add this  to the samba config file :

comment = All Users
path = /home/sambashares/allusers
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes


if  you  want   te  make user   read  and  write  in  there   own directories  add  this  in  smb.conf

comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mask = 0700
directory mask = 0700

save  and  exit

5-add user  who  should  have  accesss to  samba  share    (change  Unixmen with  your  favorite  name)

#useradd unixmen -m -G users

6-make  a password  of  unixmen user

#passwd  unixmen


7-add the  password to  unixmen user to  samba  database.

smbpasswd -a  unixmen


8-Reboot  your  samba  service  with

# /etc/init.d/smb restart

Shutting down SMB services:                           [  OK  ]
Starting SMB services:                                     [  OK  ]

Enjoy  . now  you are  ready

Back  to   your  windows  machine  :   start run    IP-of-samba-server