欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

centos7安装配置samba

程序员文章站 2022-05-17 14:01:23
...

1、安装samba

执行yum -y install samba

2、配置samba

mkdir -p samba/share     创建共享目录

chmod 777 /samba/share/   设置目录权限,否则windows下访问不能修改

修改samba配置文件:

cd /etc/samba/        定位到配置文件目录

cp smb.conf smb.conf.bak   备份配置文件

vim smb.conf     编辑配置文件

[global]
    workgroup = WORKGROUP
    security = user
    map to guest = Bad 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]
    comment = share file
    path = /samba/share
    writable = yes
    browseable = yes
    guest ok = yes

systemctl disable firewalld   禁用防火墙

vim /etc/selinux/config   修改"SELINUX=enforcing"为"SELINUX=disabled"

systemctl enable smb  自动启动smb服务

reboot   重启

3、访问共享目录

centos7安装配置samba