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:
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/'.
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
path = /mnt/biggie
comment = Zes en een halve gig partitie
writeable = yes
path = /mnt/data
comment = Data partitie
writable = yes
path = /usr/samba_temp
comment = Temp directory
writable = yes
create mask = 0744
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
[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
guest ok = boolean If YES, passwords are not needed for this share.
hosts deny = host list A list of machines that cannot connect to a share
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.
[global] log level = number Sets the logging level used.
[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.
[global] debug timestamp = boolean Timestamps all log messages.
[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
[global] local master = boolean Stands for election as the local master browser.
[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.
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.
writable = boolean Antonym to 'read only', synonym of 'write ok'
create mask = octal value Sets the maximum allowable permissions for new files.
printable = boolean Sets a share to be a print share.
print command = /absolute_path/command Sets the command used to send a spooled file to
printer = name Sets the name of the Unix printer.
printing = style Sets printing style to one of the below.
allowable values: bsd, sysv, hpux, aix, gnx, plp, lprng
For more options, more explanation, more functionality etc. etc. I suggest you read one of
By Robert Eckstein, David Collier-Brown, and Petter Kelly
Published by O'Reilly & Associates.
Click here to go back to the index.