Install And Configure Samba Server In Linux/centos 8
Samba server in linux

Install And Configure Samba Server In Linux/centos 8

Tutorials we will learn samba server in Linux/centos 8 and sharing Directories between CentOS and Windows 10.

Samba share Directory between same and Different Operating System. it is a free and open-source protocol that allows files to be shared across networks. samba is a free and open-source operating system through which you can share files and data in Linux and Windows.

The (SMB) Server Message Block Protocol is a protocol communicating with server-client with the help of which you can share files, printers, etc. from the server to the network

samba server can perform some basic task

  • you can share Linux Drive for windows across the network .
  • Linux server printers can be used in windows.
  • you can use windows printer in Linux Machine

Before configuring the samba server, make sure that Linux and Windows must be in the same workgroup. Use the following command to check the workgroup in Windows.

net config workstation

check Workgroup in windows system

Check the samba package Install or not.

You check the smb package in your system, the package is installed or Not you can check the package status .

check samba packages install or not

Install Samba and Necessary packages

if the package is not in your system install now you can install the package with the help of the below-given command.

sudo dnf install samba samba-common samba-client
Install samba and necessary  package

After successfully installing the samba package, it’s time to make some configurations, First, we will create a Directory and give it a Necessary Permission And Ownership as follow.

mkdir  /samba-share
chmod -R 777 /samba-share
chown -R nobody:nobody /samba-share
$ sudo chcon -t samba_share_t /srv/samba/shared
Create Directory,Assign Permission and ownership in centos 8

samba configuration :

first, open the vim /etc/samba/smb.conf and then change some settings as below.

vim /etc/samba/smb.conf

[global]
workgroup = WORKGROUP
Host allow = 127 192.168.43.
security = user
map to guest = bad user

[Samba-Share]
path = /samba-share
comment = share data between Centos And Windows
writable = yes
browsable =yes
guest ok = yes
samba server configuration file

Save and close the configuration file and test the configuration file is correct or not, To check the configuration file run Bellow Command. testparm is a command where you can check the samba configuration file status.

testperm

[root@simi ~ ] # testparm

check samba server configuration file

check Samba Services:

With the help of the following command, you can check the service of samba server and if the service is stopped then you can also start it.

[root@simi ~]# systemctl start smb root@simi~]#systemctl status smb [root@simi ~]# systemctl enable –now smb

Start,enable and check samba services in Centos 8

firewall setting.

If you have a running firewall service in your system, then you have to allow samba’s service in the firewall, for that you can use the following command.

[root@simi ~]# firewall-cmd –add-service=samba –permanent [root@simi ~ ]# firewall-cmd –reload

Allow Firewall Service to Samba server

Accessing Samba share from a windows machine

If you have properly configured your samba server and have configured the configuration file of samba properly, now you have to access the share file from the Windows machine that is connected across the network with the samba server. Open Windows run (window + R) and then write the ip of samba server with double slash as given below.

\\ hostname of samba server \\IP ADDRESS OF SAMBA SERVER

Access samba share Directories from windows computer by IP
Access samba share Directories from windows computer by name
Access share data which was share by Samba server

SHARE SECURE DIRECTORY From Samba Server

Like we have just learned, simply created and shared the directories and access everyone, delete it, modify it. If we want to share a very important document and access only a particular user That has been granted access permission.

Install Samba Necessary packages:

Install samba  RPM Package in CentOS 8

configure samba

After installing the package, create a group, Create directory and assign the necessary permissions and file ownership, add a new user to the newly created group,Set password to samba user that will be used when accessing the secured directory share

groupadd samba_group
mkdir /secure_data
chmod -R 770 /secure-data
chgrp samba_group /secure-data
useradd samaba-user001
smbpasswd -a samba-user001
 add Group ,change permission,ownership and add user for samba server
samba configuration:

Open the main configuration file of samba append as below given.

vim

vim /etc/samba/smb.conf
configuration file to share secure data in samba server

save exit, restart and check samba service

systemctl restart samba
systemctl enable --now smb
systemctl status smb
start and check status samba service

again login into the Windows computer, go to run ( press windows key + R) then type.

\\hostname of samba server OR \\IP ADDRESS OF SAMBA SERVER

Access samba share directory through IP

Click On OK

Access samba share directory through Hotname

Enter the username and password that was created for the samba server

Enter username and password that was created for the samba  server
Access samba share directory
Access share data which was share by samba server

Conclusion

These Tutorials We learned about the samba server in linux/CentOS Step By steps hope that now you are comfortable with Samba Server. If your problem is still not solved share your Problem via comments.

Wireless Headphone

Wireless Speaker

Earbuds

WiFi Router

Rate this post