Cover | Table of Contents | Online Book | Online Book | Colophon
grep -i 's.*m.*b' /usr/dict/words
salmonberry samba sawtimber scramble
hydra, and a pair of Windows clients, to which we will assign the names phoenix and chimaera, all connected via a local area network (LAN). Let's also assume that hydra also has a local inkjet printer connected to it, lp, and a disk share named network—both of which it can offer to the other two machines. A graphic of this network is shown in Figure 1.1.
hydra, through the Network Neighborhood of the phoenix
http://www.samba.org/.http://www.samba.org. Once connected to this
page, you'll see links to several Samba mirror sites across the
world, both for the standard Samba web pages and sites devoted
exclusively to downloading Samba. For the best performance, choose a
site that is closest to your own geographic location.http://www.samba.org. Once connected to this
page, you'll see links to several Samba mirror sites across the
world, both for the standard Samba web pages and sites devoted
exclusively to downloading Samba. For the best performance, choose a
site that is closest to your own geographic location.samba-latest.tar.gz
# ./configure --with-ssl
#./configure --help
--with-
feature option, which will cause the feature to be compiled and installed. Likewise, if you specify a --without-
feature option, the feature will be disabled. As of Samba 2.0.5, each of the following features is disabled by default:--with-smbwrapper
--with-afs
make on the command line. The make
utility will produce a stream of explanatory and success messages, beginning with:Using FLAGS = -O -Iinclude ...
# make
Using FLAGS = -O -Iinclude -I./include -I./ubiqx -I./smbwrapper -DSMBLOGFILE="/
usr/local/samba/var/log.smb" -DNMBLOGFILE="/usr/local/samba/var/log.nmb" -
DCONFIGFILE="/usr/local/samba/lib/smb.conf" -DLMHOSTSFILE="/usr/local/samba/lib/
lmhosts" -DSWATDIR="/usr/local/samba/swat" -DSBINDIR="/usr/local/samba/bin" -
DLOCKDIR="/usr/local/samba/var/locks" -DSMBRUN="/usr/local/samba/bin/smbrun" -
DCODEPAGEDIR="/usr/local/samba/lib/codepages" -DDRIVERFILE="/usr/local/samba/lib/
printers.def" -DBINDIR="/usr/local/samba/bin" -DHAVE_INCLUDES_H -DPASSWD_
PROGRAM="/bin/passwd" -DSMB_PASSWD_FILE="/usr/local/samba/private/smbpasswd"
Using FLAGS32 = -O -Iinclude -I./include -I./ubiqx -I./smbwrapper -
DSMBLOGFILE="/usr/local/samba/var/log.smb" -DNMBLOGFILE="/usr/local/samba/var/log.
nmb" -DCONFIGFILE="/usr/local/samba/lib/smb.conf" -DLMHOSTSFILE="/usr/local/samba/
lib/lmhosts" -DSWATDIR="/usr/local/samba/swat" -DSBINDIR="/usr/local/samba/bin"
-DLOCKDIR="/usr/local/samba/var/locks" -DSMBRUN="/usr/local/samba/bin/smbrun" -
DCODEPAGEDIR="/usr/local/samba/lib/codepages" -DDRIVERFILE="/usr/local/samba/lib/
printers.def" -DBINDIR="/usr/local/samba/bin" -DHAVE_INCLUDES_H -DPASSWD_
PROGRAM="/bin/passwd" -DSMB_PASSWD_FILE="/usr/local/samba/private/smbpasswd"
Using LIBS = -lreadline -ldl -lcrypt -lpam
Compiling smbd/server.c
Compiling smbd/files.c
Compiling smbd/chgpasswd.c
...(content omitted)...
Compiling rpcclient/cmd_samr.c
Compiling rpcclient/cmd_reg.c
Compiling rpcclient/cmd_srvsvc.c
Compiling rpcclient/cmd_netlogon.c
Linking bin/rpcclient
Compiling utils/smbpasswd.c
Linking bin/smbpasswd
Compiling utils/make_smbcodepage.c
Linking bin/make_smbcodepage
Compiling utils/nmblookup.c
Linking bin/nmblookup
Compiling utils/make_printerdef.c
Linking bin/make_printerdef[global] workgroup = SIMPLE [test] comment = For testing only, please path = /export/samba/test read only = no guest ok = yes
test. The server also becomes part of the named workgroup SIMPLE, which each of the clients must also be a part of. (Use your own workgroup here if you already know what it is.) We'll use the [test] share in the next chapter to set up the Windows clients. For now, you can complete the setup by performing the following commands as root on your Unix server:# mkdir /export/samba/test # chmod 777 /export/samba/test
[global]# /usr/local/samba/bin/smbd -D # /usr/local/samba/bin/nmbd -D
if [ -x /usr/local/samba/bin/smbd]; then echo "Starting smbd..." /usr/local/samba/bin/smbd -D echo "Starting nmbd..." /usr/local/samba/bin/nmbd -D fi
# smbclient -U% -L localhost
Added interface ip=192.168.220.100 bcast=192.168.220.255 nmask=255.255.255.0
Domain=[SIMPLE] OS=[Unix] Server=[Samba 2.0.5a]
Sharename Type Comment
--------- ---- -------
test Disk For testing only, please
IPC$ IPC IPC Service (Samba 2.0.5a)
Server Comment
--------- -------
HYDRA Samba 2.0.5a
Workgroup Master
--------- -------
SIMPLE HYDRA
[global] log level = 1 max log size = 1000 socket options = TCP_NODELAY IPTOS_LOWDELAY guest ok = no [homes] browseable = no map archive = yes [printers] path = /usr/tmp guest ok = yes printable = yes [test] browseable = yes read only = yes guest ok = yes path = /export/samba/test
[global] log level = 1 max log size = 1000 socket options = TCP_NODELAY IPTOS_LOWDELAY guest ok = no [homes] browseable = no map archive = yes [printers] path = /usr/tmp guest ok = yes printable = yes [test] browseable = yes read only = yes guest ok = yes path = /export/samba/test
[global] ... [homes] ... [printers] ... [test] ...
[test] and [homes] sections are each unique disk shares; they contain options that map to specific directories on the Samba server. The [printers] share contains options that map to various printers on the server. All the sections defined in the smb.conf file, with the exception of the [global] section, will be available as a disk or printer share to clients connecting to the Samba server.[globals]
section appears in virtually every Samba configuration file, even though it is not mandatory to define one. Any option set in this section of the file will apply to all the other shares, as if the contents of the section were copied into the share itself. There is one catch: other sections can list the same option in their section with a new value; this has the effect of overriding the value specified in the [globals] section.[global] log level = 1 max log size = 1000 socket options = TCP_NODELAY IPTOS_LOWDELAY guest ok = no [homes] browseable = no map archive = yes [printers] path = /usr/tmp guest ok = yes printable = yes min print space = 2000 [test] browseable = yes read only = yes guest ok = yes path = /export/samba/test
[test] share, Samba would first read in the [globals] section. At that point, it would set the option guest
ok
=
no as the global default for each share it encounters throughout the configuration file. This includes the [homes] and [printers] shares. When it reads in the [test] share, however, it would then find the configuration option guest
ok
=
yes, and override the default from the [globals] section with the value yes in the context of the [pub] share.|
Option
|
Parameters
|
Function
|
Default
|
Scope
|
|---|---|---|---|---|
config file
|
string (fully-qualified name)
|
Sets the location of a configuration file to use instead of the current one.
|
None
|
Global
|
include
|
string (fully-qualified name)
|
Specifies an additional segment of configuration options to be included at this point in the configuration file.
|
None
|
Global
|
copy
|
string (name of share)
|
Allows you to clone the configuration options of another share in the current share.
|
[global] section of your smb.conf file:[global] # Server configuration parameters netbios name = HYDRA server string = Samba %v on (%L) workgroup = SIMPLE
hydra. In addition, the machine belongs to the workgroup SIMPLE and displays a description to clients that includes the Samba version number as well as the NetBIOS name of the Samba server.encrypt passwords=yes in your earlier configuration file, you should do so here as well.phoenix and chimaera are our Windows clients.)
server
string by listing the details of the Network Neighborhood window (select the Details menu item under the View menu), at which point you should see a window similar to Figure 4.3.
hydra server. Let's continue with the configuration file and create an empty disk share called [data]. Here are the additions that will do it:[global] netbios name = HYDRA server string = Samba %v on (%L) workgroup = SIMPLE [data] path = /export/samba/data comment = Data Drive volume = Sample-Data-Drive writeable = yes guest ok = yes
[data] share is typical for a Samba disk share. The share maps to a directory on the Samba server: /export/samba/data. We've also provided a comment that describes the share as a Data
Drive, as well as a volume name for the share itself.guest
ok parameter to yes. While this isn't very security-conscious, there are some password issues that we need to understand before setting up individual users and authentication. For the moment, this will sidestep those issues and let anyone connect to the share.# mkdir /export/samba/data # chmod 777 /export/samba/data
hydra server again (you can do this by clicking on its icon in the Windows Network Neighborhood), you should see a single share listed entitled data, as shown in Figure 4.4. This share should also have read/write access to it. Try creating or copying a file into the share. Or, if you're really feeling adventurous, you can even try mapping a network drive to it!