Centos7 set up Samba server share

1. Install the smb service

yum install samba -y

2. Create a shared folder and assign a user and group, using the user landing smb

useradd -M -s /sbin/nologin smb
groupadd picture
gpasswd -a smb picture
mkdir /picture
chmod -R root:picture /picture

 3. Turn on the firewall port (if not open firewalld Services skip)

firewall-cmd --zone=public --add-port=139/tcp --permanent
firewall-cmd --zone=public --add-port=389/tcp --permanent
firewall-cmd --zone=public --add-port=445/tcp --permanent
firewall-cmd --zone=public --add-port=901/tcp --permanent

4. Set selinux (if not open selinux service is skipped)

chcon -t samba_share_t /picture -R

5. Set profile smb

we /etc/samba/smb.conf

[global]
        workgroup = WORKGROUP
        security = user
        passdb backend = tdbsam
        printing = cups
        printcap name = cups
        load printers = no
        cups options = raw
[picture]
        comment = picture
        path = /picture
        public = no
        writable = yes

Above, [picture] Parameters section is to show the shared file folder, if you need to customize it to modify [picture] parameters can be part of.

The printer is not necessary, so to remove the printer default configuration settings. 

6. Access

Looking for a windows computer, access the Explorer \\ ip address will be able to see the shared folder, do not forget to add two front slash ip address.

 

Published 28 original articles · won praise 0 · Views 2680

Guess you like

Origin blog.csdn.net/weixin_43855938/article/details/103758313