Home >Operation and Maintenance >CentOS >How to solve the problem that the samba service cannot be accessed in CentOS

How to solve the problem that the samba service cannot be accessed in CentOS

angryTom
angryTomOriginal
2020-03-20 15:35:023853browse

How to solve the problem that the samba service cannot be accessed in CentOS

How to solve the problem that the samba service cannot be accessed in CentOS

After the samba service is installed and configured under centOS, it cannot be accessed. There are two reasons:

1. The samba service cannot be accessed due to the firewall.

2. Because SELinux is started, the directory cannot be accessed.

Recommended learning: Linux tutorial

For these two problems, the corresponding solutions are:

1. The samba service is allowed through the firewall

firewall-cmd --permanent --zone=public --add-service=samba
firewall-cmd --reload

2. SELinux allows samba

View samba status

getsebool -a | grep samba

Grant permissions

setsebool -P samba_enable_home_dirs=1
chcon -t samba_share_t /data/share/

This article comes from the PHP Chinese website, CentOS usage tutorial column, please pay attention to this column for more related tutorials!

The above is the detailed content of How to solve the problem that the samba service cannot be accessed in CentOS. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn