FreeBSD连载(67):配置samba

2009-05-13 12:24:36来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折


配置samba
  虽然缺省情况已经适合大部分用户访问自己在服务器上的个人目录的要求,但是为了充分发挥samba提供的功能,与这些复杂多样的Windows网络相适应,就必须更改smb.conf的设置。以提供更多的共享设置、服务器设置,以及用于支持包括比较简单的共享方式和复杂的域认证方式在内的认证方式。
  smb.conf中的语法非常简单,整个配置文件分为多个不同的部分,每个部分具有一个标题。使用方括号将标题引起来,标题下包括一些相关设置,每一行都用于一个相关设置。设置文件中的每个部分或者定义了一个共享资源的名字,或者设置了一组参数。以下以缺省smb.conf为例,介绍smb.conf中的相关设置。

  • [global]设置

# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options (perhaps too
# many!) most of which are not shown in this example
#
# Any line which starts with a ; (semi-colon) or a # (hash)
# is a comment and is ignored. In this example we will use a #
# for commentry and a ; for parts of the config file that you
# may wish to enable
#
# NOTE: Whenever you modify this file you should run the command "testparm"
# to check that you have not many any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
  [global]部分定义了服务器本身使用的配置参数,以及其他共享资源部分使用的缺省配置参数,因此相当重要。
# workgroup = NT-Domain-Name or Workgroup-Name, eg: REDHAT4
   workgroup = MYGROUP
  工作组设置本地网络使用工作组名字(或者是NT域名字),这对于将正确进行浏览数据中非常重要。否则,Windows客户就不能从其网络邻居中发现这个Samba服务器。
# server string is the equivalent of the NT Description field
   server string = Samba Server
  server string是对于本地服务器的简单描述,这些信息将作为这台服务器的属性,返回给Browser,显示在Windows客户中作为对这个服务器的描述。
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page
;   hosts allow = 192.168.1. 192.168.2. 127.
  hosts allow参数用于限制可以访问这台samba服务器的客户机的IP地址范围,通过指定一系列网络地址,使得只有这些网络中的计算机才能访问这台服务器提供的资源,以提供安全限制。缺省情况下,这行配置被注释了,使得所有的客户都可以访问这台计算机,这样就存在一定的安全问题。
# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
   load printers = yes

# you may wish to override the location of the printcap file
;   printcap name = /etc/printcap

# on SystemV system setting printcap name to lpstat should allow
# you to automatically obtain a printer list from the SystemV spool

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:FreeBSD连载(66):安装samba

下一篇:FreeBSD连载(68):根据Windows网络设置Samba