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.
Now set the password for the user test,
smbpasswd -a test
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
Make an original copy of smb.conf
cd /etc/samba/ cp smb.conf smb.conf-back
Write the code in smb.conf file.
With a group, make only changes as valid users = @groupname
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.
And try to create any folder and write a file.
YouTube Link: Samba file sharing
You’re done samba configure user access and install