Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 14. Samba


Samba is an open-source implementation of the Server Message Block (SMB) and Common Internet File System (CIFS) protocols that provides file and print services between clients across various operating systems.[15]
In Red Hat Enterprise Linux, the samba package provides the Samba server. Enter the following command to see if the samba package is installed:
~]$ rpm -q samba
package samba is not installed
Copy to Clipboard Toggle word wrap
If it is not installed and you want to use Samba, use the yum utility as the root user to install it:
~]# yum install samba
Copy to Clipboard Toggle word wrap

14.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 the getenforce command to confirm SELinux is running in enforcing mode:
    ~]$ getenforce
    Enforcing
    
    Copy to Clipboard Toggle word wrap
    The command returns Enforcing when SELinux is running in enforcing mode.
  2. Enter the following command as root to start smbd:
    ~]# systemctl start smb.service
    Copy to Clipboard Toggle word wrap
    Confirm that the service is running. The output should include the information below (only the time stamp will differ):
    ~]# systemctl status smb.service
    smb.service - Samba SMB Daemon
       Loaded: loaded (/usr/lib/systemd/system/smb.service; disabled)
       Active: active (running) since Mon 2013-08-05 12:17:26 CEST; 2h 22min ago
    
    Copy to Clipboard Toggle word wrap
  3. To view the smbd processes, execute the following command:
    ~]$ ps -eZ | grep smb
    system_u:system_r:smbd_t:s0      9653 ?        00:00:00 smbd
    system_u:system_r:smbd_t:s0      9654?        00:00:00 smbd
    
    Copy to Clipboard Toggle word wrap
    The SELinux context associated with the smbd processes is system_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, cannot access files labeled with the httpd_sys_content_t type, which is intended for use by the Apache HTTP Server. Booleans must be enabled to allow certain behavior, such as allowing home directories and NFS volumes to be exported through Samba, as well as to allow Samba to act as a domain controller.


[15] For more information, see the Samba section in the System Administrator's Guide.
Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat