| |
Network: Samba: Simple configuration(last edit: 2001-03-18)
This is a sample samba configuration. It will create one samba server. With a few shares and
one shared printer.
The log files are configured different as the default. In this example all log files are
written to the dir '/var/log/samba' which doesn't exist by default so you'll have to
create it. In this dir all log files are named '%m.log'. So lets pretend you have a windows
machine named 'Admin' and a machine named 'Sales'. Then these log files will be created:
/var/log/samba]ls -al
total 6072
drwxr-xr-x 2 root wheel 512 Aug 28 01:10 .
drwxr-xr-x 3 root wheel 1024 Aug 29 02:12 ..
-rw-r--r-- 1 root wheel 33788 Aug 28 00:16 nmb.log
-rw-r--r-- 1 root wheel 1225907 Aug 28 01:11 admin.log
-rw-r--r-- 1 root wheel 4871875 Aug 28 01:10 sales.log
-rw-r--r-- 1 root wheel 11927 Aug 27 23:25 smb.log
The best thing is to place the 'smb.conf' file in the dir '/usr/local/etc/'.
smb.conf
--------------
[global]
netbios name = Biggie
server string = Samba server
workgroup = toys
encrypt passwords = yes
guest ok = no
hosts allow = 192.168.0. localhost
log level = 3
log file = /var/log/samba/%m.log
max log size = 50
debug timestamp = yes
os level = 34
local master = yes
preferred master = yes
[biggie]
path = /mnt/biggie
comment = Zes en een halve gig partitie
writeable = yes
[data]
path = /mnt/data
comment = Data partitie
writable = yes
[tmp]
path = /usr/samba_temp
comment = Temp directory
writable = yes
create mask = 0744
[Brother HL730]
comment = Brother netwerk printer
printable = yes
print command = /usr/bin/lpr -r %s
printer = lp
printing = BSD
--------------
Now let's take closer look at these options:
[global] means that this specific option is only usable in the global section. Below options
whithout [global] can appear in both the global section and share sections.
[global] netbios name = hostname Sets the NetBIOS name by which a Samba server is
known, or primary name if NetBIOS aliasses exists.
[global] server string = text Sets the name that appears beside a server in browse
lists.
[global] workgroup = name Sets the workgroup to which things will be served.
[global] encrypt passwords = boolean Uses Windows NT-stle password encryption. Set this
to YES when you use win98/nt/2000
Windows 95 : Non-Encrypted
Windows 95 with SMB update : Encrypted
Windows 98 : Encrypted
Windows NT 3.x : Non-Encrypted
Windows NT 4.0 before SP3 : Non-Encrypted
Windows NT 4.0 after SP3 : Encrypted
Windows 2000 : Encrypted
DEFAULT: NO
guest ok = boolean If YES, passwords are not needed for this share.
DEFAULT: NO
hosts deny = host list A list of machines that cannot connect to a share
or shares.
DEFAULT: NULL
hosts allow = host list A list of machines that can access a share or
shares. If NULL any machine can access the share
unless there is a hosts deny option.
DEFAULT: NULL
[global] log level = number Sets the logging level used.
DEFAULT :0
[global] log file = pathname Set name and location of the log file.
[global] max log size = number Sets the size (in kilobytes) at which Samba will
start a new log file. The current log file will be
renamed with an .old extension.
DEFAULT: 5000
[global] debug timestamp = boolean Timestamps all log messages.
DEFAULT: YES
[globsl] os level = number Sets the candidacy of the server when electing
a browse master.
Windows for Workgroups : 1
Windows 95 : 1
Windows 98 : 2
Windows NT Ws 3.51 : 16
Windows NT Ws 4.0 : 17
Windows NT Server 3.51 : 32
Windows NT Server 4.0 : 33
DEFAULT: 0
[global] local master = boolean Stands for election as the local master browser.
DEFAULT: YES
[global] preferred master = boolean If YES, Samba is prefered to become the master
browser. Causes Sambe to call a browsing election
when it comes online.
DEFAULT: NO
path = pathname Sets the path to the directory provided by a
file share or used by a printer share.
comment = text Sets the comment that appears beside a share in
a NET VIEW or in the details list.
DEFAULT: NULL
writable = boolean Antonym to 'read only', synonym of 'write ok'
DEFAULT: YES
create mask = octal value Sets the maximum allowable permissions for new files.
DEFAULT: 0744
printable = boolean Sets a share to be a print share.
DEFAULT: NO
print command = /absolute_path/command Sets the command used to send a spooled file to
the printer.
printer = name Sets the name of the Unix printer.
DEFAULT: lp
printing = style Sets printing style to one of the below.
allowable values: bsd, sysv, hpux, aix, gnx, plp, lprng
DEFAULT: BSD
For more options, more explanation, more functionality etc. etc. I suggest you read one of
the following:
Advanced configuration
The book:
Using samba
By Robert Eckstein, David Collier-Brown, and Petter Kelly
Published by O'Reilly & Associates.
ISBN: 1-56592-449-5
Click here to go back to the index.
|