What is Samba Server?

Kashyapvikash
2 min readFeb 23, 2024

--

A Samba server is a software application that allows file and print sharing between Unix/Linux and Windows systems over a network.
It enables computers running Unix/Linux to share files and printers with Windows computers, and vice versa.

Configuration of Samba Server in RHEL — 9

  • *Server side configuration*

step-1. install samba pkg

#yum install samba* -y

step-2. create dir for network share and provide 777 permission

#mkdir /samba-dir

#chmod 777 /samba-dir

step-3. create a useradd

#useradd vikas

step4. Edit smb config file and add some points

#vim /etc/samba.smb.conf

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run ‘testparm’ to verify the config is correct after
# you modified it.
#
# Note:
# SMB1 is disabled by default. This means clients without support for SMB2 or
# SMB3 are no longer able to connect to smbd (by default).

[global]
workgroup = SAMBA
security = user

passdb backend = tdbsam

printing = cups
printcap name = cups
load printers = yes
cups options = raw

[homes]
comment = Home Directories
valid users = %S, %D%w%S
browseable = No
read only = No
inherit acls = Yes

[printers]
comment = All Printers
path = /var/tmp
printable = Yes
create mask = 0600
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/drivers
write list = @printadmin root
force group = @printadmin
create mask = 0664
directory mask = 0775

[samba-dir]
comment = This is my SMB dir
path = /samba-dir
public = yes
writeable = yes
browseable = yes
user list = vikas

step-4. start,enable and restart service for Samba.service

#systemctl enable — now smb

#systemctl restart smb

step-5. add service in firewall

#firewall-cmd — permanent — add-service=smba

#firewall-cmd — reload

#step-6. check smb port add

#netstat -tunlp | grep smb

step-7. smb password set on “vikas” user

#smbpasswd -a vikas

step-8. smb dir share on network

#chcon -R -t samba_share_t /share

Client side configuration

step-1. install smb client pkg

# yum install samba-client

#yum install cifs-utils

step-2. create a dir for mount

#mkdir /smbmount

step-3. mount dir on smbmount smb-server-ip<192.168.25.130>

# mount -t cifs //192.168.25.130/samba-dir /smbmount -o username=vikas

step-4 check mount point

#df -hT

step-5. for permanent mount

#vim /etc/fstab

//192.168.25.130/samba-dir /smbmount cifs defaults,username=vikas,password=redhat 0 0

for windows use

Type here to search== //smb-ip

--

--