Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Red Hat Enterprise Linux 9 Essentials Book now available.

Purchase a copy of Red Hat Enterprise Linux 9 (RHEL 9) Essentials

Red Hat Enterprise Linux 9 Essentials Print and eBook (PDF) editions contain 34 chapters and 298 pages

Preview Book

Chapter 4. Samba

From the Samba website:
"Samba is an Open Source/Free Software suite that has, since 1992, provided file and print services to all manner of SMB/CIFS clients, including the numerous versions of Microsoft Windows operating systems. Samba is freely available under the GNU General Public License.".[6]
In Red Hat Enterprise Linux, the samba package provides the Samba server. Run rpm -q samba to see if the samba package is installed. If it is not installed and you want to use Samba, run the following command as the root user to install it:
yum install samba

4.1. Samba and SELinux

When SELinux is enabled, the Samba server (smbd) runs confined by default. Confined services run in their own domains, and are separated from other confined services. The following example demonstrates the smbd process running in its own domain. This example assumes the samba package is installed:
  1. Run getenforce to confirm SELinux is running in enforcing mode:
    $ getenforce
    Enforcing
    
    The getenforce command returns Enforcing when SELinux is running in enforcing mode.
  2. Run service smbd start as the root user to start smbd:
    service smb start
    Starting SMB services:                                     [  OK  ]
    
  3. Run ps -eZ | grep smb to view the smbd processes:
    $ ps -eZ | grep smb
    unconfined_u:system_r:smbd_t:s0 16420 ?        00:00:00 smbd
    unconfined_u:system_r:smbd_t:s0 16422 ?        00:00:00 smbd
    
    The SELinux context associated with the smbd processes is unconfined_u:system_r:smbd_t:s0. The second last part of the context, smbd_t, is the type. A type defines a domain for processes and a type for files. In this case, the smbd processes are running in the smbd_t domain.
Files must be labeled correctly to allow smbd to access and share them. For example, smbd can read and write to files labeled with the samba_share_t type, but by default, can not access files labeled with the httpd_sys_content_t type, which is intended for use by the Apache HTTP Server. Booleans must be turned on to allow certain behavior, such as allowing home directories and NFS file systems to be exported through Samba, as well as to allow Samba to act as a domain controller.


[6] From the opening paragraph on the Samba website: https://samba.org. Accessed 20 January 2009.


 
 
  Published under the terms of the Creative Commons License Design by Interspire