Install Samba on CentOS 7 for File Sharing

Windows Articles

How to Block a phone number on Android

Hello friends. In this post, we will show you how to block a phone number on Android. Have you ever wondered how...

How to install Java 15 on CentOS 8 / CentOS 7

Recently Java 15 has been released with interesting new features in the accounting field and introducing many security patches. In spite of...

How to increase privacy in Windows 10.

Hello! Without a doubt the time of use of electronic devices has increased lately. Indeed, with the limitations imposed by the COVID-19...

How to install Java 15 on OpenSUSE 15.2?

Recently Java 15 has been released with interesting new features in the accounting field and introducing many security patches. In spite of...

How to install Redis on CentOS 8?

Hello, friends in this post, we will show you how to install Redis on CentOS 8 As we well...
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

How to Block a phone number on Android

Hello friends. In this post, we will show you how to block a phone number on Android. Have you ever wondered how...

How to install Java 15 on CentOS 8 / CentOS 7

Recently Java 15 has been released with interesting new features in the accounting field and introducing many security patches. In spite of...

How to increase privacy in Windows 10.

Hello! Without a doubt the time of use of electronic devices has increased lately. Indeed, with the limitations imposed by the COVID-19...

How to install Java 15 on OpenSUSE 15.2?

Recently Java 15 has been released with interesting new features in the accounting field and introducing many security patches. In spite of...

How to install Redis on CentOS 8?

Hello, friends in this post, we will show you how to install Redis on CentOS 8 As we well...
x