P. 1
Samba

Samba

|Views: 167|Likes:
Publicado porNurul Istiqomah

More info:

Published by: Nurul Istiqomah on Dec 14, 2010
Direitos Autorais:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

02/21/2014

pdf

text

original

Samba’s parameterdefaults greatly ease the administrative workload by reducing the size
and complexity of the smb.conffile. There may be times when you find yourself “undo-
ing”one of these defaults in most shares and wish another default for that parameter had
been picked. Such situations are easily accommodated with global share parameters—
that is,share parameters placed in the global section.

Example: Global read only=yes

This simple smb.confprevents writing to the share and enables the homesdirectory (as
well as username) to show up in browses:

encrypt passwords=yes
netbios name=mainserv
workgroup=mygroup
[homes]

Creating a Turnkey Samba System

PARTII

170

Note

The read only=parameter has three inverse synonyms: writeable=, writable=,
and write ok=. Therefore, read only=no, writeable=yes, writable=yes, and

write ok=yesall mean the same thing and perform the same function.

The read only=parameter is a “first among equals,” because both testparm
and SWAT report this property as read only=rather than writeable=,

writable=, or write ok=.

09 8628 CH06 3/17/00 12:54 PM Page 170

Restart Samba and note that in Network Neighborhood,both homesand usernameshow
up (they’re really the same share). Also note that you cannot create a directory in either.
The default for the browseable=and read only=parameters is yes.

Previous examples got rid of homeswith browseable=noand made [homes]read/write
by inserting read only=no. This time,you can defeat those defaults by inserting the
same lines in the global area. The difference is that when they’re in the global area,they
serve as the default for all shares,although they can be overridden inside any specific
share.

Here’s smb.confwith read only=noinserted at the top:

read only=no
encrypt passwords=yes
netbios name=mainserv
workgroup=mygroup
[homes]

Restart Samba and note that you can now create directories in the usernamedirectory via
Network Neighborhood. The global read only=noapplies to all shares,including

[homes].

Example: Global browseable=no

Not all global share parameters are that simple. This example shows how a global

browseable=noremoves browseability not only from [homes]but from IPC$as well,
thus causing unexpected consequences.

Remove read only=and add browseable=noto the top of the file. This is how smb.conf
looks now:

browseable=no
encrypt passwords=yes
netbios name=mainserv
workgroup=mygroup
[homes]

Restart Samba and browse Network Neighborhood. Previous experience with the

browseable=parameter in the [homes]share leads to the expectation that the homes
directory will disappear from Network Neighborhood,leaving only the directory
named after your username,usernamein this example. However,that’s not what hap-
pens. In fact,neither homesnor usernameis visible. Here’s the explanation:The global

browseable=noremoves browseability not only from [homes]but from IPC$as well.
Without a browseable IPC$,the usernamerepresentation of [homes]is not browseable
either.

Creating a Simple Samba Proof of Concept

CHAPTER6

171

6

C

R
E
A
T
I
N
G
A

S

I
M
P
L
E

S

A
M
B
A

P

R
O
O
F
O
F

C

O
N
C
E
P
T

09 8628 CH06 3/17/00 12:54 PM Page 171

The absence of IPC$is verified by the smbclientbrowse command:

$ smbclient -NL mainserv

Added interface ip=192.168.100.1 bcast=192.168.100.255 nmask=255.255.255.0
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.0.3]

Sharename Type Comment
--------- ---- -------

Server Comment
--------- -------
MAINSERV Samba 2.0.3

Workgroup Master
--------- -------
MYGROUP

$

IPC$is not there.

The situation is rectified by moving the browseable=nofrom the top to the bottom of the
file,under [homes]. After Samba restarts,the smbclientbrowse shows the desired result
(usernamebut not homes):

$ smbclient -NL mainserv

Added interface ip=192.168.100.1 bcast=192.168.100.255 nmask=255.255.255.0
Domain=[MYGROUP] OS=[Unix] Server=[Samba 2.0.3]

Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (Samba 2.0.3)

Server Comment
--------- -------
MAINSERV Samba 2.0.3
P2300 P2300 Steves Main Computer

Workgroup Master
--------- -------
MYGROUP P2300

$

IPC$is once again visible. The usernamedirectory is now visible in Network
Neighborhood.

Creating a Turnkey Samba System

PARTII

172

Note

IPC$is a special share used in browsing and other Samba internals. It’s a special
interprocess communication share that handles browse lists. Source code ipc.c
and smb.hprovide excellent documentation on the subject.

09 8628 CH06 3/17/00 12:54 PM Page 172

You're Reading a Free Preview

Descarregar
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->