How To Configure Samba Server In Linux

Samba (SMB) is an open source and free software suite that runs on Linux/UNIX based system but it also communicate with Windows client like a native application. It is a file sharing server. It is used to share files between Windows and Linux/UNIX systems. Samba is able to provide this service by employing the common Internet File System (CIFS). The heart of CIFS is the Server Message Block (SMB).

In this article I am going to explain how you can configure SAMBA server in Linux  systems. Follow the below steps.

Step #1 . First you will need to create a directory where you want to keep data and share with other remote system such as Solaris,Windows, UNIX etc.

# mkdir /data

Step #2. Now you will need to install Samba server on system.

On RHEL/Fedora/CentOS

# yum install samba

On Ubuntu/Debian

$sudo apt-get install samba

Step #3. After installing samba server, configure it using it’s main configuration file “/etc/samba/smb.conf“.

# vim /etc/samba/smb.conf

workgroup = windows-group.

server string = Linux-Share

comment = secured shared folder
path = /srv/samba/data
Valid users = sagar faeem
guest ok = no
writable = yes
privatable = no
browsable = yes

Save and exit


  • Workgroup : Where this server belongs. When windows user try to access any network resource they first try to access my network place and then search for workgroup then to server.
  • server string : Name of this samba server search, Here that name is Linux-Share.
  • [sharedfolder] : Share name, When any users access samba server through network this will be visible as folder shared.
  • comment : Use for any comment, which help to know what is this share for.
  • path : Location of shared folder, this is used to specific which folder you want to share.
  • valid users : Specifies which user is having access on this folder.
  • writable : Privide the access control to user whether users are able to write or not. In this example they can read and write.
  • privatable : It indecate whether this folder is private or not.
  • browsable : It is used to specify whether the folder content is browsable or not.

Step #4. Now create password for the users. So that users can access this samba share remotely.

#smbpasswd -a sagar
#smbpasswd -a faeem

Set the password for above users, password is stored in ” /etc/samba/smbpasswd ” file.

Step #5. Execute the below command for syntax check for smb.conf file.

# testparm

Step #6. Now restart samba service.

# service smb restart

Step #7. Keep on samba service on during booting time, samba service will start if server restarted.

#chkconfig smb on

I hope this article will help to configure samba server on Linux/UNIX systems. If you have any queries and problem please comment in comment section.




Managing Web Traffic Load With HaProxy HaProxy is used to decrease the web application server load. It also used to decrease the database server load. It can handle a lot of traffic. Simi...
How to install and configure OSSEC Client/Agent Mo... OSSEC agent is a small program. Agent installed on the system to be monitored. It collects all information and forward it to the server for analysis a...
How to Run and Use Windows Software on Linux Machi... Linux is more powerful Operating System then other Operating System.But some time you may need to run Windows  Software on Linux machine like playing ...
PHP 5.4 installation steps on CentOS 6.x and Redha... OVERVIEW:PHP is the scripting language which is used to generate dynamic web page, PHP script contain HTML,Text and script blocks. Whenever an...
How to Run Process or Program on Specific CPU Core... Multi-core CPUs becoming popular these days on server-grade hardware and end-user desktop PCs, Laptops. Suppose we have a multi-core processor, whenev...
Googler – Command Line Google Search On Linu... OVERVIEW:Googler is the command line search tools. You can search web, news, google sites search etc just typing command in Linux. Every Linux u...


Hi! I'm Sagar and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

2 thoughts on “How To Configure Samba Server In Linux

  1. hi is this possible to access live centos server folder on local windows PC if it is possible please
    let me know this article is good so please tell me the procedure

    1. Hi Ravindra,
      Thanks for reading my post. Yes you can also access your live centos server folder on your local PC with samba. Just follow the above steps and change the “path = /srv/samba/data” to your foder/directory like “path = /data” that’s it.

Leave a Reply

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