centos7搭建samba

2020-04-16  本文已影响0人  一剑仙人跪_

下载

 yum -y install samba samba-common samba-client

创建共享目录

mkdir -p /var/ftp/share
chmod 777 /var/ftp/share

配置文件

/etc/samba smb.conf

# See smb.conf.example for a more detailed config file or
# read the smb.conf manpage.
# Run 'testparm' to verify the config is correct after
# you modified it.

[global]
    workgroup = SAMBA
    security = user

    passdb backend = tdbsam

    printing = cups
    printcap name = cups
    load printers = yes
    cups options = raw

[homes]
    comment = Home Directories
    valid users = %S, %D%w%S
    browseable = No
    read only = No
    inherit acls = Yes

[printers]
    comment = All Printers
    path = /var/tmp
    printable = Yes
    create mask = 0600
    browseable = No

[print$]
    comment = Printer Drivers
    path = /var/lib/samba/drivers
    write list = @printadmin root
    force group = @printadmin
    create mask = 0664
    directory mask = 0775
[share]
        path = /var/ftp/share
        comment = samba
        public = yes
        writable = yes
        browseable = yes
        guest ok = yes
        valid users = ftp
        available = yes

创建登录用户

useradd -d /var/ftp/share/ -s /sbin/nologin ftp
passwd ftp
smbpasswd -a ftp

启动

systemctl start smb.service

windows添加

image.png
上一篇下一篇

猜你喜欢

热点阅读