Install Samba on CentOS 7 for File Sharing

Windows Articles

Learn how to control the volume of Windows using the mouse wheel.

Hi! Windows recently celebrated its 35th anniversary. Therefore, it is one of the longest lasting and most used systems currently. On the other hand,...

Install Nim programming language on Ubuntu 20.04 / Debian 10

Nowadays, almost everything is done with the help of a computer and a program. And the programs are made through a programming language. That...

Configure Samba File share Services with Ubuntu 20.04 LTS

Here, Today! let's discuss samba file share service with Ubuntu 20.04 LTS. If you need to share files between Linux and MS Windows...

Install Matomo on Ubuntu 20.04

Hello, friends. In this post, you will learn how to install Matomo on Ubuntu 20.04. It's quite useful to measure the traffic to our...

How to change DNS in Windows 10

Hi! Today we will talk a bit about networks. In fact, we will touch on a topic related to connectivity. Specifically we will see...
Muhammad Nabeel
Muhammad Nabeel
Network and System Administrator

In our last article, You will learn how to install and configure Samba on CentOS 7 for file sharing between other Linux and Windows systems.

Step: 1 Install Samba Server

Use below command to install samba with necessary packages.

# yum install samba samba-common samba-client -y

Step 2: Check Windows Workgroup

Before samba configurations, make sure Windows machine is in same workgroup.
open the cmd prompt in Windows machine and run the following command.

> net config workstation

Step 3: Samba Configuration

before configuration rename samba default configuration file /etc/samba/smb.conf as backup using below command.

# mv /etc/samba/smb.conf /etc/samba/smb.conf.default

Samba Anonymous File Sharing

Now create a shared folder on the server where all files/folders will be stored and set appropriate permissions on it and allow selinux for the samba configuration.

Run below commands

# mkdir -p /srv/samba/anonymous

# chmod -R 0755 /srv/samba/anonymous

# chown -R nobody:nobody /srv/samba/anonymous

# chcon -t samba_share_t /srv/samba/anonymous

Now make following changes in new samba configuration file.

# vi /etc/samba/smb.conf
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = centos
security = user
map to guest = bad user
dns proxy = no

[Anonymous]
path = /srv/samba/anonymous
browsable =yes
writable = yes
guest ok = yes
read only = no

Run below commant to verify samba configurations

# testparm

Step 4: Start and Add Samba Services in firewall

Run below command to allow samba in firewall

# firewall-cmd --permanent --add-service=samba

# firewall-cmd --reload

Run below command to start and enable samba services.

# systemctl start smb.service

# systemctl enable smb.service

# systemctl start nmb.service

# systemctl enable nmb.service

Step 5: Access Shared folder

Now you can access the Centos shared folder from windows, open Run prompt by pressing win + r key on your keyboard then type \\centos and press enter key.

You will see Anonymous folder like below

Now you can add files/folders in this folder to share with other users.

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

Learn how to control the volume of Windows using the mouse wheel.

Hi! Windows recently celebrated its 35th anniversary. Therefore, it is one of the longest lasting and most used systems currently. On the other hand,...

Install Nim programming language on Ubuntu 20.04 / Debian 10

Nowadays, almost everything is done with the help of a computer and a program. And the programs are made through a programming language. That...

Configure Samba File share Services with Ubuntu 20.04 LTS

Here, Today! let's discuss samba file share service with Ubuntu 20.04 LTS. If you need to share files between Linux and MS Windows...

Install Matomo on Ubuntu 20.04

Hello, friends. In this post, you will learn how to install Matomo on Ubuntu 20.04. It's quite useful to measure the traffic to our...

How to change DNS in Windows 10

Hi! Today we will talk a bit about networks. In fact, we will touch on a topic related to connectivity. Specifically we will see...
x