此内容没有您所选择的语言版本。
Chapter 3. 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.[4]
In Red Hat Enterprise Linux, the samba package provides the Samba server. Run the
rpm -q samba command 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
~]# yum install samba
3.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:
- Run the
getenforcecommand to confirm SELinux is running in enforcing mode:getenforce
~]$ getenforce EnforcingCopy to Clipboard Copied! Toggle word wrap Toggle overflow Thegetenforcecommand returnsEnforcingwhen SELinux is running in enforcing mode. - Run the
service smbd startcommand as the root user to startsmbd:service smb start
~]# service smb start Starting SMB services: [ OK ]Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Run the
ps -eZ | grep smbcommand to view thesmbdprocesses:ps -eZ | grep smb
~]$ 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 smbdCopy to Clipboard Copied! Toggle word wrap Toggle overflow The SELinux context associated with thesmbdprocesses isunconfined_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, thesmbdprocesses 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.