Install and Configure Samba Server in Centos 7


Few days ago I was going for an overtime in office just to finish installing samba in a Centos 7 minimal for my working server. Two consecutive nights, samba didn’t install correctly after several tries. Third night came, I called a help from one of my bosses and wtf it was just a common mistake that I ignore that made the samba runs. Hahha! Poor me.

Samba is an open source, and free software suite that provides file and print services to the SMB/CIFS clients. It allows us to share files, folders, and printers between Linux server and Windows clients. Using Samba, we can setup a domain controller on Unix/Linux server, and integrate the Windows clients to the Domain controller.

Here’s a detailed step on how to setup a basic samba client in Centos 7 Server.

I used a two systems as describe below:

Samba Server:


Samba Client:



  1. Install Samba                       

Check for existing samba package installed in the server using the following commands:



If samba is installed, remove it using these commands:


After removing, install samba.



  1. Configuring fully accessed test share

 Let’s configure a fully accessed share for users. We will name it test_share. Anyone can read or write in this share.

Create a directory called ‘/samba/test_share’ and set full permission. You can name this share as per your liking.


Edit samba configuration file:

Tip: You can install midnight commander for a clear and easy way to view or edit files.


Or simply use nano or vi command.



 Find the following directives and make the changes below:


  1. Start samba services




If all runs well, you’re good for the next step.

  1. Firewall Configuration

Allow Samba server default ports through firewall.


Restart firewall to apply the changes.


  1. Selinux Configuration

 Turn the samba_enable_home_dirs Boolean on if you want to share home directories via Samba.


If you create a new directory, such as a new top-level directory, label it with samba_share_t so that SELinux allows Samba to read and write to it. Do not label system directories, such as /etc/ and /home/, with samba_share_t, as such directories should already have an SELinux label.

If you don’t want to mess up with the SELinux, just disable it as shown below, and continue.

To disable SELinux, edit file at /etc/sysconfig/selinux


Set SELinux value to disabled.


Restart the server to take effect the changes.

  1. Test samba shares

Now, go to any windows client system. In this example, I am using Windows 10 system.

Press Ctrl + R. Enter the samba Server IP as shown below.


Now, you’ll be able to access the fully accessed samba shares.



Author: Jessica Apostol

Loves to discover and explore new things that lies beyond the universe. Geeky nerd.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.