CentOS 7安装配置Samba

本文详细介绍了Samba服务的两种配置方法,包括全局设置、共享目录配置等,并提供了具体步骤如重启服务、权限设置等,帮助读者实现Windows与Linux间的文件共享。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

from:

http://www.centoscn.com/CentosServer/ftp/2015/0929/6248.html

http://www.centoscn.com/CentosServer/ftp/2015/0131/4606.html

配置文件1:

# 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


[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
        ;writable = 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 = root
        create mask = 0664
        directory mask = 0775


[share]
        comment = my share directory
        path = /home/pzb/workSpace
        public = yes
        writable = yes
        read only = no
        browseable = yes
        valid users = pzb

 

配置文件2:

# 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 = WORKGROUP
        server string = Samba Server Version %v
        # logs split per machine
        # max 50KB per log file, then rotate
        security = user
        passdb backend = tdbsam
        # the login script name depends on the machine name
        # the login script name depends on the unix user used
        # disables profiles support by specifing an empty path
        load printers = yes
        cups options = raw
        #obtain list of printers automatically on SystemV
[project]
       commnet = Public Share with movie files
       path = /root/TeamTalk-master
       # valid user = abc,@root
       # write list = hanlg,root
       public = yes
       read only = no
[homes]
        comment = Home Directories
        browseable = no


      writable = yes
[printers]
        comment = All Printers
        path = /root/TeamTalk-master
        public = yes
        writable = yes
        browseable = yes
        printable = no
        guest ok = yes
[share]
        comment = my share directory
        path = /root/TeamTalk-master
        public = yes
        writable = yes
        read only = no
        browseable = yes
        valid users = root

 

配置文件1 或 配置文件2

任选一个

smbpasswd -a root,输入密码

保证服务启动,防火墙关闭,关闭SELinux(参考),修改共享目录的属性,chown root.root /root/TeamTalk-master一定不能少

WINDOWS下:  “"映射网络驱动器"”配置链接共享目录

 

samba服务
    systemctl restart smb 
    systemctl status smb

 

启动Samba服务,设置开机启动

[root@base samba]# systemctl start smb
[root@base samba]# systemctl enable smb

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值