CentOS7安装配置Samba

xiaoxiao2021-02-28  104

转载自:https://www.howtoforge.com/samba-server-installation-and-configuration-on-centos-7

First I will explain the methodology to install the samba with the anonymous sharing. To install samba run,

yum install samba samba-client samba-common Now to configure samba edit the file  /etc/samba/smb.conf before making changes I will make the backup of original file as  /etc/samba/smb.conf.bak

mv /etc/samba/smb.conf /etc/samba/smb.conf.bak Further give the entries like this vi /etc/samba/smb.conf [global] workgroup = WORKGROUP server string = Samba Server %v netbios name = centos security = user map to guest = bad user dns proxy = no #============================ Share Definitions ============================== [Anonymous] path = /samba/anonymous browsable =yes writable = yes guest ok = yes read only = no mkdir -p /samba/anonymous systemctl enable smb.service systemctl enable nmb.service systemctl restart smb.service systemctl restart nmb.serviceFurther CentOS 7.0 Firewall-cmd will block the samba access, to get rid of that we will run:

firewall-cmd --permanent --zone=public --add-service=samba firewall-cmd --reloadNow you can access the Centos 7.0 sharing in windows as follows, go to the Run prompt

From a windows machine just browse the folder and try to create a text file, but you will get an error of permission denied. Check the permission for the shared folder.

To allow anonymous user give the permissions as follows:

cd /samba chmod -R 0755 anonymous/ chown -R nobody:nobody anonymous/

Further, we need to allow the SELinux for the samba configuration as follows:

chcon -t samba_share_t anonymous/

Now anonymous user can browse & create the folder contents.

转载请注明原文地址: https://www.6miu.com/read-29897.html

最新回复(0)