How to Install Samba on CentOS 8


Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

How to Install Samba on CentOS 8

Samba is an open-source software suite that allows file and print sharing between different operating systems.

Step 1: Update the System

To start, update your CentOS 8 system to ensure you have the latest packages:

        $ sudo dnf update -y

Step 2: Install Samba

Use the following command to install Samba:

        $ sudo dnf install samba samba-client -y

Step 3: Configure the Samba Service

Next, you need to configure the Samba service by editing the main configuration file:

        $ sudo vi /etc/samba/smb.conf

Make the necessary changes according to your requirements. Here's an example of a basic configuration:

# Global section
    workgroup = WORKGROUP
    server string = Samba Server
    log file = /var/log/samba/%m.log
    max log size = 50
    security = user
    encrypt passwords = yes

# Share definition
    path = /path/to/share
    browseable = yes
    writable = yes
    guest ok = no
    valid users = user1 user2

Step 4: Create a Samba User

Create a user who will have access to the Samba share:

        $ sudo useradd -M -s /sbin/nologin samba_user

Set a password for the user:

        $ sudo smbpasswd -a samba_user

Step 5: Enable and Start the Samba Service

Enable the Samba service to start automatically on system boot:

        $ sudo systemctl enable smb

Start the Samba service:

        $ sudo systemctl start smb

Step 6: Configure Firewalld

If you're using Firewalld, allow Samba services in the firewall:

        $ sudo firewall-cmd --permanent --add-service=samba
        $ sudo firewall-cmd --reload

Step 7: Access Samba Share

You can now access the Samba share from any Windows, Linux, or macOS machine using the following path:


Replace with the IP address or hostname of your CentOS system, and with the name of the share defined in the smb.conf file.

That's it! You have successfully installed and configured Samba on CentOS 8.

Refer A Friend
Get $25

Installing Samba
CentOS 8
Samba server
Samba share
Samba configuration
Samba file sharing
Samba setup
CentOS Samba installation
Samba tutorial
CentOS Samba setup.

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.