samba sharing on linux

How To Configure Samba Server For File Sharing 

Samba Server is an open source file and printer sharing services. you can configure samba server in Linux. This is 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

I’m supposing you have installed samba server on your machine. Today i will show how to access directory on 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 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 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 those user. share folder samba

usermod -aG groupname username

Step 3 : if you have firewall enable 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.

samba install and configure

With group, make only changes in 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. samba configure user access

just click on your share directory folder and login as registered user. In our case, we made 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. samba install and configure

share files with samba

YouTube Link : Samba file sharing

You’re done

LEAVE A REPLY

Please enter your comment!
Please enter your name here