SMB configuration (1)

Source: Internet
Author: User

1: first, determine if SELinux is the problem:
1.1 display the current user's SELinux contex

# ID-z

1.2 view SELinux status

# Sestatus-BV

1.3: We can temporarily disable SELinux to use the Samba server:

# Setenforce 0

(# Setenforce 1 --- enable SELinux)
2. Set Samba (this step is simpler on the image interface)
Edit the/etc/samba/smb. conf file!
Add at the bottom:

[Gongxiang]
Path =/gongxiang
Writeable = Yes
; Browseable = Yes
Valid users = gongxiang # Before this operation, we have created a new account name: shared common account, and have full permission to this directory as agreed!

3. Let's cancel SELinux's samba restrictions!
3.1 view SELinux's samba settings

[Root @ host ~] # Getsebool-A | grep samba
Samba_enable_home_dirs --> off
Samba_cmd_nfs --> off
Use_samba_home_dirs --> off


3.2 remove SELinux's samba restrictions

[Root @ host ~] # Setsebool-P samba_enable_home_dirs 1


3.3 check SELinux's samba settings.

[Root @ host ~] # Getsebool-A | grep samba
Samba_enable_home_dirs --> on
Samba_cmd_nfs --> off
Use_samba_home_dirs --> off

3.4 restart the samba Service

[Root @ host ~] # Service SMB restart

3.5: This Command Re-enables SELinux's samba restrictions (haha, you do not need to use)

[Root @ host ~] # Setsebool-P samba_enable_home_dirs 0

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.