0% found this document useful (0 votes)
2 views5 pages

SMB File Sharing

This document provides an overview of setting up and configuring a Samba server for SMB file sharing, including installation, user creation, and firewall settings. It outlines commands for both server and client configurations, as well as SELinux adjustments for shared directories. Key functionalities include sharing files between Windows and Linux systems and managing Samba shares through configuration files and command-line tools.

Uploaded by

cgaren16
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views5 pages

SMB File Sharing

This document provides an overview of setting up and configuring a Samba server for SMB file sharing, including installation, user creation, and firewall settings. It outlines commands for both server and client configurations, as well as SELinux adjustments for shared directories. Key functionalities include sharing files between Windows and Linux systems and managing Samba shares through configuration files and command-line tools.

Uploaded by

cgaren16
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

 Module 3

 SMB File Sharing

 Samba Server Overview


 Creating SMB Share
 Provide network shares suitable for group collaboration
 Samba Overview:

 Samba is an Open Source Project and uses the Common Internet File System ( CIFS ).
 It allows us to share files or directories to different Operating Systems ( Windows & Linux ).
 Main Configuration File “ /etc/samba/[Link] “.
 Client will mount the Samba Share using the “cifs-utils “ and “ samba-client “ Packages.
 Samba uses nmb service for NetBIOS Name or Naming Service.
 We can use # smbpasswd –a Command to create password for samba username.
 We can connect to samba from the client using # smbclient –L Command.
 It listens in tcp ports “ 139 & 445 “.
 We can use # smbstatus to show the information about the samba server.
 Finally we use # testparm to check the parameters of the [Link] config file.
 Configuring SMB Server and Client
 Install and Activate Samba on Server:
# yum install samba –y
# systemctl enable smb nmb && systemctl start smb nmb
 Firewall rule for Samba:
# firewall-cmd –permanent –add-service=samba
# firewall-cmd –reload
 Create Samba User:
# useradd smbuser –s /sbin/nologin
# smbpasswd –a smbuser
 Create your share on the Configuration file /etc/samba/[Link] and you can
allow a specific host in the Global Options then you can # testparm to check the
configuration.
 On the Samba Client:
 Install the Related Packages:
# yum install cifs-utils samba-client –y
 Add firewall rule:
# firewall-cmd –permanent –add-service=samba-client
# firewall-cmd –reload
 Brows the Samba Share on the Server:
# smbclient –L [Link] –U smbuser
 Mount the samba share:
# mount //[Link]/samba-share /mnt –o username=smbuser
 Or we can mount it on the /etc/fstab file as the below:
# //[Link]/samba-share /mnt cifs username=smbuser,password=password 0 0
 Selinux Settings
 We have /samba-share Exported Directory by Samba Server so we can adjust the
selinux as the following:
# semanage fcontext –a –t samba_share_t “/samba-share(/.*)?”
# restorecon –Rv /samba-share
 And for the Selinux Boolean settings we can do the following:
# setsebool –P samba_export_all_ro on ##if you need it read only.
# setsebool –P samba_export_all_rw on ##if you need it read and write.

You might also like