How To Configure Samba Server For File Sharing On CentOS 7

Samba Server is an open-source file and printer sharing services. you can configure samba server in Linux. This is a free software re-implementation of SMB networking protocols. You can share files on both Linux and windows. you can samba install and configure and can also give user based samba access to the directory.

Check Out: How To Install Samba File Sharing Server

How To Configure Samba Server For File Sharing:

I’m supposing you have installed a samba server on your machine. Today I will show how to access the directory on the Linux server from your machine over the network. you can share folder samba directory.

yum install samba samba-client samba-common -y

Step 1: Create a user and set the samba password for that user.

useradd test

Now set the password for the user test,

smbpasswd -a test

Check Out:  How To Install Monit Process Monitoring Tool On Linux 7

Step 2: Make a directory to share it with users and change the owner of that directory and give the R/W permission on that folder to the user.

mkdir /data
chown -R test /data
chmod 775 /data

if you need this, you can also make a group and user in the group that directory will be accessed by that user. share folder samba

usermod -aG groupname username

Step 3: if you have a firewall enabled on the machine. So you will have to open the port 137, 445 and 139 and if SELinux is enabled, so you need to change the SELinux context on the directory.

chcon -R -t samba_share_t /data

Check Out: How To Create a Clone of Existing Virtual Machine In VMWare

Make an original copy of smb.conf

cd /etc/samba/
cp smb.conf smb.conf-back

Write the code in smb.conf file.

samba install and configure

With a group, make only changes as valid users = @groupname

Check Out: What Is Samba Server And Benefits of Using this Server

Step 4: Now access the samba share directory from windows and just type the ipaddress in run command.   s nfigure user access

just click on your share directory folder and login as a registered user. In our case, we made a test user. And click on connect.

samba configure user access

Check Out: How To Delete File And Logs Older Than 30 Days In Linux

And try to create any folder and write a file.

share files with samba

YouTube Link: Samba file sharing

You’re done samba configure user access and install

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment