天天看點

samba

# 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

#

# for a step to step guide . installing, configuring and using samba,

# read the samba-howto-collection. this may be obtained from:

#  [url]http://www.samba.org/samba/docs/samba-howto-collection.pdf[/url]

# many working examples of smb.conf files can be found in the

# samba-guide which is generated daily and can be downloaded from:

#  [url]http://www.samba.org/samba/docs/samba-guide.pdf[/url]

# 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 made any basic syntactic errors.

#======================= global settings =====================================

[global]

# workgroup = nt-domain-name or workgroup-name, eg: midearth

   workgroup = student

# server string is the equivalent of the nt de.ion field

   server string = samba server

# security mode. defines in which mode samba will operate. possible

# values are share, user, server, domain and ads. most people will want

# user level security. see the samba-howto-collection for details.

   security = share

# this option is important for security. it allows you to restrict

# connections to machines which are . 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.2.0

# 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

# . systemv system setting printcap name to lpstat should allow

# you to automatically obtain a printer list from the systemv spool

# system

;   printcap name = lpstat

# it should not be necessary to specify the print system type unless

# it is non-standard. currently supported print systems include:

# bsd, cups, sysv, plp, lprng, aix, hpux, qnx

;   printing = cups

# this option tells cups that the data has already been rasterized

cups options = raw

# uncomment this if you want a guest account, you must add this to /etc/passwd

# otherwise the user "nobody" is used

  guest account = xiaozhe

# this tells samba to use a separate log file for each machine

# that connects

   log file = /var/log/samba/%m.log

# put a capping . the size of the log files (in kb).

   max log size = 50

# use password server option .ly with security = server

# the argument list may include:

#   password server = my_pdc_name [my_bdc_name] [my_next_bdc_name]

# or to auto-locate the domain controller/s

#   password server = *

;   password server = <nt-server-name>

# use the realm option .ly with security = ads

# specifies the active directory realm the host is part of

;   realm = my_realm

# backend to store user information in. new installations should

# use either tdbsam or ldapsam. smbpasswd is available for backwards

# compatibility. tdbsam requires no further configuration.

;   passdb backend = tdbsam

# using the following line enables you to customise your configuration

# . a per machine basis. the %m gets replaced with the netbios name

# of the machine that is connecting.

# note: consider carefully the location in the configuration file of

#       this line.  the included file is read at that point.

;   include = /usr/local/samba/lib/smb.conf.%m

# configure samba to use multiple interfaces

# if you have multiple network interfaces then you must list them

# here. see the man page for details.

   interfaces = eth0 

# browser control options:

# set local master to no if you don't want samba to become a master

# browser . your network. otherwise the normal election rules apply

;   local master = no

# os level determines the precedence of this server in master browser

# elections. the default value should be reasonable

;   os level = 33

# domain master specifies samba to be the domain master browser. this

# allows samba to collate browse lists between subnets. don't use this

# if you already have a windows nt domain controller doing this job

;   domain master = yes

# preferred master causes samba to force a local browser election . startup

# and gives it a slightly higher chance of winning the election

;   preferred master = yes

# enable this if you want samba to be a domain logon server for

# windows95 workstations.

;   domain logons = yes

# if you enable domain logons then you may want a per-machine or

# per user logon .

# run a specific logon batch file per workstation (machine)

;   logon . = %m.bat

# run a specific logon batch file per username

;   logon . = %u.bat

# where to store roving profiles (only for win95 and winnt)

#        %l substitutes for this servers netbios name, %u is username

#        you must uncomment the [profiles] share below

;   logon path = \\%l\profiles\%u

# windows internet name serving support section:

# wins support - tells the nmbd component of samba to enable it's wins server

;   wins support = yes

# wins server - tells the nmbd components of samba to be a wins client

# note: samba can be either a wins server, or a wins client, but not both

;   wins server = w.x.y.z

# wins proxy - tells samba to answer name resolution queries .

# behalf of a non wins capable client, for this to work there must be

# at least .e wins server . the network. the default is no.

;   wins proxy = yes

# dns proxy - tells samba whether or not to try to resolve netbios names

# via dns nslookups. the default is no.

   dns proxy = no

# these .s are used . a domain controller or stand-alone

# machine to add or delete corresponding unix accounts

;  add user . = /usr/sbin/useradd %u

;  add group . = /usr/sbin/groupadd %g

;  add machine . = /usr/sbin/adduser -n -g machines -c machine -d /dev/null -s /bin/false %u

;  delete user . = /usr/sbin/userdel %u

;  delete user from group . = /usr/sbin/deluser %u %g

;  delete group . = /usr/sbin/groupdel %g

#============================ share definitions ==============================

[homes]

   comment = home directories

   browseable = no

   writable = yes

# un-comment the following and create the netlogon directory for domain logons

; [netlogon]

;   comment = network logon service

;   path = /usr/local/samba/lib/netlogon

;   guest ok = yes

;   writable = no

;   share modes = no

# un-comment the following to provide a specific roving profile share

# the default is to use the user's home directory

;[profiles]

;    path = /usr/local/samba/profiles

;    browseable = no

;    guest ok = yes

# note: if you have a bsd-style print system there is no need to

# specifically define each individual printer

[printers]

   comment = all printers

   path = /usr/spool/samba

# set public = yes to allow user 'guest account' to print

   guest ok = no

   writable = no

   printable = yes

# this .e is useful for people to share files

;[tmp]

;   comment = temporary file space

;   path = /tmp

;   read .ly = no

;   public = yes

# a publicly accessible directory, but read .ly, except for people in

# the "staff" group

;[public]

;   comment = public stuff

;   path = /home/samba

;   writable = yes

;   printable = no

;   write list = @staff

# other examples.

# a private printer, usable .ly by fred. spool data will be placed in fred's

# home directory. note that fred must have write access to the spool directory,

# wherever it is.

;[fredsprn]

;   comment = fred's printer

;   valid users = fred

;   path = /homes/fred

;   printer = freds_printer

;   public = no

;   printable = yes

# a private directory, usable .ly by fred. note that fred requires write

# access to the directory.

;[fredsdir]

;   comment = fred's service

;   path = /usr/somewhere/private

# a service which has a different directory for each machine that connects

# this allows you to tailor configurations to incoming machines. you could

# also use the %u option to tailor it by user name.

# the %m gets replaced with the machine name that is connecting.

;[pchome]

;  comment = pc directories

;  path = /usr/pc/%m

;  public = no

;  writable = yes

# a publicly accessible directory, read/write to all users. note that all files

# created in the directory by users will be owned by the default user, so

# any user with access can delete any other user's files. obviously this

# directory must be writable by the default user. another user could of course

# be specified, in which case all files would be owned by that user instead.

;   path = /usr/somewhere/else/public

;   .ly guest = yes

# the following two entries demonstrate how to share a directory so that two

# users can place files there that will be owned by the specific users. in this

# setup, the directory should be writable by both users and should have the

# sticky bit set . it to prevent abuse. obviously this could be extended to

# as many users as required.

;[myshare]

;   comment = mary's and fred's stuff

;   path = /usr/somewhere/shared

;   valid users = mary fred

;   create mask = 0765

[myshare]

    comment=myshare

    path=/var/ftp

    public=yes

    writable=yes

[myuser]

    comment=myuser

    path=/etc

    valid users=xiaozhe

增加使用者(系統賬戶):?smbpasswd -c /etc/samba/password xiaozhe

繼續閱讀