从网上找到描述比较详细的smb.conf中文解释:

  • 服务名:smb
  • 配置目录:/etc/sabma/
  • 主配置文件:/etc/sabma/smb.conf
#============================== Global Settings =============================

[global]
samba服务器的全局设置,对整个服务器有效。 workgroup
语法:workgtoup = <工作组群>;
预设:workgroup = MYGROUP
说明:设定 Samba Server 的工作组
例:workgroup = workgroup 和WIN2000S设为一个组,可在网上邻居可中看到共享。 server string
语法:server string = <说明>;
预设:sarver string = Samba Server
说明:设定 Samba Server 的注释
其他:支持变量 t%-访问时间 I%-客户端IP m%-客户端主机名 M%-客户端域名 S%-客户端用户名
例:server string = this is a Samba Server 设定出现在Windows网上邻居的 Samba Server 注释为 this is a Samba Server hosts allow
语法:hosts aoolw = <IP地址>; ...
预设:; host allow = 192.168.1. 192.168.2. 127.
说明:限制允许连接到 Samba Server 的机器,多个参数以空格隔开。表示方法可以为完整的IP地址,如 192.168.0.1 网段,如 192.168.0.
例:hosts allow = 192.168.1. 192.168.0.1 表示允许 192.168.1 网段的机器网址为 192.168.0.1 的机器连接到自己的 samba server printcap name
语法:printcap name = <打印机配置文件>;
预设:printcap name = /etc/printcap
说明:设定 samba srever 打印机的配置文件
例:printcap name = /etc/printcap 设定 samba srever 参考 /etc/printcap 档的打印机设定。 load printers
语法:load printers = <yes/no>;
预设:load printers = yes
说明:是否在开启 samba server 时即共享打印机。 printing
语法:printing = <打印机类型>;
预设:printing = lprng
说明:设定 samba server 打印机所使用的类型,为目前所支持的类型。 guest account
语法:guert account = <帐户名称>;
预设:guert account = pcguest
说明:设定访问 samba server 的来宾帐户(即访问时不用输入用户名和密码的帐户),若设为pcguest的话则为默认为"nobody"用户。
例:guert account = andy 设定设定访问 samba server 的来宾帐户以andy用户登陆,则此登陆帐户享有andy用户的所有权限。 log file
语法:log file = <日志文件>;
预设:log file = /var/log/samba/%m.log
说明:设定 samba server 日志文件的储存位置和文件名(%m代表客户端主机名) max log size
语法:max log size = <??KB>;
预设:max log size = 0
说明:设定日子文件的最大容量,单位KB 这里的预设值0代表不做限制。 security
语法:security = <等级>;
预设:security = user
说明:设定访问 samba server 的安全级别共有四种:
share---不需要提供用户名和密码。
user----需要提供用户名和密码,而且身份验证由 samba server 负责。
server--需要提供用户名和密码,可指定其他机器(winNT/2000/XP)或另一台 samba server作身份验证。
domain--需要提供用户名和密码,指定winNT/2000/XP域服务器作身份验证。 password server
语法:password server = <IP地址/主机名>;
预设:password server = <NT-Server-Name>;
说明:指定某台服务器(包括windows 和 linux)的密码,作为用户登入时验证的密码。
其他:此项需配合 security = server时,才可设定本参数。 password level
语法:password level = <位数>;
username level = <位数>;
预设:password level = 8 username level
username level = 8
说明:设定用户名和密码的位数,预设为8位字符。 encrypt passwords
语法:encrypt passwords = <yes/no>;
预设:encrypt passwords = yse
说明:设定是否对samba的密码加密。 smb passwd file
语法:smb passwd file = <密码文件>;
预设:smb passwd file = /etc/samba/smbpasswd
说明:设定samba的密码文件。 local master
语法:local master = <yes/no>;
预设:local master = no
说明:设定 samba server 是否要担当LMB角色(LMB负责收集本地网络的Browse List资源),通常无特殊原因设为no os level
语法:os level = <数字>;
预设:os level = 33
说明:设定 samba server的os level. os level从 0 到 255 . winNT的os level为33, win95/98的os level 是 1 .若要拿samba server 当LMB或DMB则它的os level至少要大于NT的33以上。 domain master
语法:domain master = <yes/no>;
预设:domain master = yes
说明:设定 samba server 是否要担当DMB角色(DMB会负责收集其他子网的Browse List资源),通常无特殊原因设为no preferred master
语法:preferred master = <yes/no>;
预设:preferred master = yes
说明:设定 samba server 是否要担当PDC角色(PDC会负责追踪网络帐户进行的一切变更),通常无特殊原因设为no,(同一网段内不可有两个PDC,他们会每5分钟抢主控权一次) wins support
语法:wins support = <yes/no>;
预设:wins support = yes
说明:设定samba server 是否想网络提供WINS服务,通常无特殊原因设为no。除非所处网络上没有主机提供WINS服务且需要此台samba server提供WINS服务是才设yes,其他 wins support 和 wins server 只能选择一个 wins server
语法:wins server = <IP地址>;
预设:wins server = w.x.y.z
说明:设定samba server 是否要使用别台主机提供的WINS服务,通常无特殊原因设为no。除非所处网络上有一台主机提供WINS服务才要设yes,其他 wins support 和 wins server
例:wins server = 192.168.0.1 表示samba server要使用192.168.0.1提供的WINS服务 #============================== Share Definitions ============================= [homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S 使用者本身的"家"目录,当使用者以samba使用者身份登入samba server 后,samba server 底下会看到自己的家目录,目录名称是使用者自己的帐号。 [printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes 设置了samba服务器中打印共享资源的属性,samba服务器除了可以提供文件共享,还可以提供打印共享。 [分享的资源名称]
<指令1>; = (参数)
<指令2>; = (参数) 要提供分享资源时,须先把欲分享的资源以 [ ] 符号括住,底下通常会带指令和参数来表示此资源的设定和存取权限等,详情如下: comment---------注释说明
path------------分享资源的完整路径名称,除了路径要正确外,目录的权限也要设对
browseable------是yes/否no在浏览资源中显示共享目录,若为否则必须指定共享路径才能存取
printable-------是yes/否no允许打印
hide dot ftles--是yes/否no隐藏隐藏文件
public----------是yes/否no公开共享,若为否则进行身份验证(只有当security = share 时此项才起作用)
guest ok--------是yes/否no公开共享,若为否则进行身份验证(只有当security = share 时此项才起作用)
read only-------是yes/否no以只读方式共享当与writable发生冲突时也writable为准
writable--------是yes/否no不以只读方式共享当与read only发生冲突时,无视read only
vaild users-----设定只有此名单内的用户才能访问共享资源(拒绝优先)(用户名/@组名)
invalid users---设定只有此名单内的用户不能访问共享资源(拒绝优先)(用户名/@组名)
read list-------设定此名单内的成员为只读(用户名/@组名)
write list------若设定为只读时,则只有此设定的名单内的成员才可作写入动作(用户名/@组名)
create mask-----建立文件时所给的权限
directory mask--建立目录时所给的权限
force group-----指定存取资源时须以此设定的群组使用者进入才能存取(用户名/@组名)
force user------指定存取资源时须以此设定的使用者进入才能存取(用户名/@组名)
allow hosts-----设定只有此网段/IP的用户才能访问共享资源
allwo hosts = 网段 except IP
deny hosts------设定只有此网段/IP的用户不能访问共享资源
allow hosts=本网段指定IP指定IP
deny hosts=指定IP本网段指定IP
在使用Samba进行建立Window与Linux共享时,要是不能访问,出现“您可能没有权限使用网络资源”,

那就是SELinux在作怪了
要是想让共享目录能访问,可以使用命令
#setenforce 0
暂时停掉SELinux
使用
#setenforce 1
启用SELinux
 
有关SELinux 在系统中的作用就不讲了,另外一种方法可以不用关闭SELinux.以下命令将允许这个权限:
setsebool -P samba_enable_home_dirs=1
 
 
 ————————————————————————————————————————————————

若SElinux啟用中,在Windows檔案總管無法連到 Samba 所分享出來的目錄時,

在Linux 中,可執行下列指令:

setsebool -P samba_enable_home_dirs on

參考文件: /etc/samba/smb.conf

#---------------
# SELINUX NOTES:
# 分享群組
# If you want to use the useradd/groupadd family of binaries please run:
setsebool -P samba_domain_controller on
#

# 分享home目錄
# If you want to share home directories via samba please run:
setsebool -P samba_enable_home_dirs on
#
# If you create a new directory you want to share you should mark it as
# "samba-share_t" so that selinux will let you write into it.
# Make sure not to do that on system directories as they may already have
# been marked with othe SELinux labels.
#
# Use ls -ldZ /path to see which context a directory has
#
# Set labels only on directories you created!
# To set a label use the following: chcon -t samba_share_t /path
#
# If you need to share a system created directory you can use one of the
# following (read-only/read-write):
# setsebool -P samba_export_all_ro on
# or
# setsebool -P samba_export_all_rw on
#
# If you want to run scripts (preexec/root prexec/print command/...) please
# put them into the /var/lib/samba/scripts directory so that smbd will be
# allowed to run them.
# Make sure you COPY them and not MOVE them so that the right SELinux context
# is applied, to check all is ok use restorecon -R -v /var/lib/samba/scripts
#
#--------------
#


Linux Samba服务主配文件smb.conf中文详解的更多相关文章

  1. Linux Samba服务主配文件smb.conf中文详解【转】

    转自:https://blog.csdn.net/maotianwang/article/details/52524732 从网上找到描述比较详细的smb.conf中文解释: 服务名:smb 配置目录 ...

  2. [转]Reids配置文件redis.conf中文详解

    转自: Reids配置文件redis.conf中文详解 redis的各种配置都是在redis.conf文件中进行配置的. 有关其每项配置的中文详细解释如下: 对应的中文版解释redis.conf # ...

  3. Nginx安全相关配置和nginx.conf中文详解

    一.centos下redis安全相关 1.背景 在使用云服务器时,如果我们的redis关闭了protected-mode模式,被病毒攻击的可能会大大增加,因此我们使用redis时候,最好更改默认端口, ...

  4. Nginx配置文件nginx.conf中文详解(转)

    ######Nginx配置文件nginx.conf中文详解##### #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_ ...

  5. Nginx配置文件nginx.conf中文详解【转】

    PS:Nginx使用有两三年了,现在经常碰到有新用户问一些很基本的问题,我也没时间一一回答,今天下午花了点时间,结合自己的使用经验,把Nginx的主要配置参数说明分享一下,也参考了一些网络的内容,这篇 ...

  6. Nginx 配置文件nginx.conf中文详解

    ######Nginx配置文件nginx.conf中文详解##### #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_ ...

  7. Reids配置文件redis.conf中文详解

    redis的各种配置都是在redis.conf文件中进行配置的. 有关其每项配置的中文详细解释如下: 附redis.conf英文原版: # Redis configuration file examp ...

  8. redis conf 中文详解

    # Redis示例配置文件 # 注意单位问题:当需要设置内存大小的时候,可以使用类似1k.5GB.4M这样的常见格式: # # 1k => 1000 bytes # 1kb => 1024 ...

  9. Nginx配置文件nginx.conf中文详解

    #定义Nginx运行的用户和用户组user www www; #nginx进程数,建议设置为等于CPU总核心数.worker_processes 8; #全局错误日志定义类型,[ debug | in ...

随机推荐

  1. 《Troubleshooting SQL Server》读书笔记-CPU使用率过高(下)

    <Troubleshooting SQL Server>读书笔记-CPU使用率过高(下) 第三章 High CPU Utilization. CPU使用率过高的常见原因 查询优化器会尽量从 ...

  2. TOGAF架构开发方法(ADM)之架构变更管理阶段

    TOGAF架构开发方法(ADM)之架构变更管理阶段 1.10 架构变更管理(Architecture Change Management) 企业架构开发方法各阶段——架构变更管理 1.10.1 目标 ...

  3. [置顶] IT老男人读《因为痛,所以叫青春》

    最近偶然,从别人的书桌上看到这本书,其中有个关于时间的解释,很是让为成功焦虑的老男人受用.   因此,我喜欢将人生的80年跟一天中的24小时进行对照. 人生时钟的计算方法十分简单.24小时相当于144 ...

  4. 在 Cordova/Phonegap for Android 中包含中文文件名的页面

    在 Cordova/Phonegap for Android 中包含中文文件名的页面 本贴首发于: http://xuekaiyuan.com/forum.php?mod=viewthread& ...

  5. Windows系统架构

    操作系统模型   大多数操作系统中,都会把应用程序和内核代码分离运行在不同的模式下.内核模式访问系统数据和硬件,应用程序运行在没有特权的模式下(用户模式),只能使用有限的API,且不能直接访问硬件.当 ...

  6. spark单机部署及样例运行

    spark单机运行部署 环境预装 需要预先下载jdk和spark.机器使用centos6.6(推荐).然后依次运行 [root@spark-master root]# cd /root #安装必要的软 ...

  7. angularJs中自定义directive的数据交互

    首先放官方文档地址:https://docs.angularjs.org/guide/directive 就我对directive的粗浅理解,它一般用于独立Dom元素的封装,应用场合为控件重用和逻辑模 ...

  8. 数据库中的null问题

    在数据库中有些列的值可以为null,这一篇,我们围绕数据库中的null来讲述. 1. null与 “”.0的区别   数据库中的null表示——不知道,“”——一个空字符串,0则是一个数值.  所以n ...

  9. Url以.(点)结尾,在使用httpwebrequest读取的时候,微软会有一个bug……

    解决方法在此,不重复做赘述,传送门:http://stackoverflow.com/questions/856885/httpwebrequest-to-url-with-dot-at-the-en ...

  10. 《如何阅读一本书》(How to Read a Book)

    值得一读的书,有深入浅出,也有并不能完全读懂的部分,以下是第11章对之前内容的总结整理. 阅读的层次 1. 基础阅读 2. 检视阅读 3. 分析阅读 4. 主题阅读 分析阅读 第一阶段:这本书在谈些什 ...