| |
Network: Samba: Advanced configuration(last edit: 2001-03-18)
This is a sample samba configuration. It will provide two virtual servers: one as file server
and one as print server. There will be three config files:
smb.conf
smb.biggie
smb.printers
The 'smb.conf' file is the main config file, the 'smb.biggie' is the file server and the
'smb.printers' the print server.
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 [homes] share is a 'special' share. It will try to share the current users FreeBSD home dir.
This share will only be accessible to this specific user. So if the user 'jappe' has a login
on your FreeBSD machine and I am logged on as 'jappe' on my windows machine I will see my
FreeBSD home dir. But a user named 'sales' will not see my home dir. If you want to know
all about the [homes] share type 'man smb.conf' or read the book (see end of document).
The [printers] share will look for all available printers in the printcap file and will
share all of them.
The best thing it to put these files in '/usr/local/etc':
smb.conf
------------------
[global]
netbios name = Biggie
netbios aliases = Printers
server string = Samba server on (%L)
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
bind interfaces only = yes
interfaces = 127.0.0.1 192.168.0.1
os level = 34
local master = yes
preferred master = yes
include = /usr/local/etc/smb.%L
------------------
smb.biggie
------------------
[homes]
comment = "Home Directory for : %u "
path = /usr/home/%u
browseable = no
writeable = yes
[biggie]
path = /mnt/biggie
comment = "Zes en een halve gig schijf"
writeable = yes
[japware]
path = /mnt/japware
comment = "CDRom partitie"
writable = yes
[data]
path = /mnt/data
comment = "Data partitie"
writable = yes
------------------
smb.printers
------------------
[global]
printing = BSD
print command = /usr/bin/lpr -r %s
printcap name = /etc/printcap
load printers = yes
[printers]
path = /var/spool/printers
printable = yes
browseable = no
------------------
This is what happens: Samba reads the 'smb.conf' file until it reaches the line
include = /usr/local/etc/smb.%L
Then it will include the file 'smb.biggie' or 'smb.printers' at this line. And thus you
create two virtual servers. It is ofcourse also possible to configure multiple file servers
or multiple print servers.
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] netbios aliases = list Adds additional NetBIOS names by which a Samba
server will advertise itself.
[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
[global] bind interfaces only = boolean If set to YES, shares and browsing will be provided
only on interfaces in an interface list. Be sure to
add 127.0.0.1 to the interface list to allow smbpasswd
to connect to the local machineto change passwords.
DEFAULT: NO
[global] interfaces = interface list Sets the interfaces to which Samba will respopnd.
The default is the machine's primary interface only.
DEFAULT: NULL
allowable values: IP addresses seperated by spaces.
[global] 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
include = pathname Include the named file in smb.conf at the line where
it appears.
DEFAULT: NULL
path = pathname Sets the path to the directory provided by a
file share or used by a printer share.
browseable = boolean Allows a share to be announced in browse lists.
DEFAULT: YES
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.
printing = style Sets printing style to one of the below.
allowable values: bsd, sysv, hpux, aix, gnx, plp, lprng
DEFAULT: BSD
[global] printcap name = pathname Sets the path to the printer capabilities file used
by the [printers] share.
[global] load printers = boolean Load all printer names from the master browser.
DEFAULT: YES
For more options, more explanation, more functionality etc. etc. I suggest you read the following:
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.
|