[nzlug] samba: puzzled user...
Cliff Pratt
enkidu at cliffp.com
Sun Mar 9 21:06:44 NZDT 2008
Simon Bridge wrote:
> On Sun, 2008-03-09 at 19:10 +1300, Robin Sheat wrote:
>> On Sunday 09 March 2008 18:13:47 Simon Bridge wrote:
>>> Do we really expect a user to enter the CLI to access, say,
>>> workplace provided shares? I see that there are gui-based
>>> tools... surely a user expects to enter "network neighborhood"
>>> (or Places > Network) and just see the available services?
>>> Perhaps Places > Connect to Server to "activate" a service?
>> From what I understand (and use): Places -> Network -> Windows
>> Network, pick the workgroup and the computer. Or, from a file
>> manager window, enter the location (e.g. smb://computername)
>>
>> This doesn't mount it on the filesystem, but gives access to Gnome
>> VFS-supporting applications, which is what I need 99% of the time.
>>
>>
> OK - so the workgroup talk is a red herring - - -
>
Yes. You share with the machine. The only use of the workgroup is if you
are browsing for a machine and you know it is in workgroup X.
>
>>> This is curious as no such thing is needed when I just share a
>>> directory.
>> Samba as installed has a workgroup defined.
>> System->Administration->Shared Folders->General Properties tab will
>> let you change it.
>>
>>> Consider: In Ubuntu I can rt-click on the ~/Public folder and
>>> select "Share this folder" - enter the desired workgroup, and
>>> that's it. I can
>> You enter the desired share name, which is completely different.
>>
> Actually - entered both. But you're right - that dialog is not where
> the workgroup got entered. Setting a unique share name turned out to
> be useful otherwise I ended up with 5 shares called "Public". OK -
> they ended up in a subdirectory of the computer hostname.
>
Yes, I wondered about that. Were you expecting a single folder called
"Public" will all machines sharing it? Or replicating data between them?
It doesn't work like that. A machine shares out one of its folders which
all other machines can connect to. If you want a folder shared between
many machines *one* machine has the folder, shares it out and all other
machines connect to the shared (out) folder.
But I may be reading too much into what you said....
>
> So it strikes me that it may just be useful, for the setup I have,
> just to name the "workgroup" after the host and have done with it.
>
It's probably tidier, if you are browsing for shares to have them all in
the one workgroup.
>
>>> Once set up, the share seems to show up in XP's network
>>> neighborhood and in Places > Network... but not all for all
>>> connected linux machines.
>> Because windows networking is a bit rubbish, and sometimes machines
>> just refuse to show up. Usually you can access them directly by
>> typing the name.
> Sayy what? Where?
>
>>
>> You'll see a lot of stories, with just plain windows networks,
>> where machine A can see B and C, B can only see A, and C can only
>> see B, and similar stupid things.
> OK - so here I was thinking in terms of consistent behaviour and the
> thing is renowned for not working consistently. Gotcha. No wonder I
> was driving myself up the wall.
>
There is usually a reason. One reason is Windows needs a Master Browser
and this function 'claimed' by any new server that could be a Master
Browser. Then an election takes place. This can result in more than one
server thinking it is the Master Browser and chaos ensues. Usually
specifically setting machines *NOT* to try to be Master Browser fixes
95% of the problems.
>
>>> Which then leads to wondering what happens where a network has
>>> several different workgroups, or a laptop moving between
>>> networks.
>> It'll keep its workgroup name as it moves. Even if it ends up being
>> the only machine in that workgroup.
>
> Workgroup name is associated with the machine really - it's just that
> there can be many machines, on the same network, with the same
> workgroup name, where hostnames need to be unique?
>
Workgroups contain machines, but it's not a concept that is used a lot.
>
>>> I'm not sure how to clarify... how does the client know what to
>>> ask for? Well: presumably the user tells it. Like - "request all
>>> shares in workgroup 'fubar'" or instructions to that effect.
>> No, request all shares on machine 'bazz'.
>>
> Right - so a new machine joins a network, it's samba client announces
> "I am here" and goes into a huddle with the servers... the servers
> basically say "Hi, I'm Bazz, I'm in workgroup fubar, have I got a
> folder for you: extra folds..." sort of thing?
>
No, it's an on demand thing. If Bazz is on the network all shares are
potentially accessible to it. There is no central repository of shares
(unless there is a Master Browser), and Bazz will ask machine X what its
shares are if it wants to ask. Normally the user of Bazz is told connect
to share Y on machine X. Browsing is an extra convenience layer on top
of this. I'm unsure of the details of browsing on Samba servers, but any
machines that runs the nmb service (by default, all Samba server, I
think) can potentially server browsing information.
>
>>> So - what if I want to share a directory to every computer that
>>> comes along... so when the server gets any request for a share in
>>> any workgroup, a particular share gets sent irregardless of
>>> whether the requested workgroup exists.
>> Well, you'd be asking a machine for the share, workgroup
>> independent.
>>
> i.e. ALL shares on a machine should be "visible" to all clients on
> the network, except for the usual Windows Network snafu.
>
They are, by default, regardless of workgroup. However a machines has to
*ask* for a share that has been shared out by a server.
>
>>> Probably indigo prime needs to restart samba server.
>> When it gets sticky like that, you can just /etc/init.d/samba
>> restart. It'll often help, but it's rarely needed.
>>
> It is usual that at least one out of these five machines will not be
> visible without a restart. This time it was two.
>
>>> If I alter one of the machines so that system > shared folders >
>>> general has a different workgroup, reboot, then that machine no
>>> longer appears in the others' smb:///
>> Sometimes it can take a while for the new workgroup information to
>> propagate. Sometimes it doesn't show up at all because windows
>> networking is a bit rubbish.
> OK - but how long before I decide that it's not going to happen...
> 10mins? So why didn't the mount work? Why do all these people insist
> that the workgroups have to match - or is that only in the windows
> world?
>
All what people? Workgroups only apply to browsing, ie looking for
shared out shares.
>
>> What we really need is a Linux/UNIX-oriented file sharing system
>> that can be easily mounted, whether by the kernel or by e.g.
>> Gnome-VFS, and advertises by avahi, which has always seemed a whole
>> lot more reliable to me. And it'll mean it'll handle file names and
>> permissions that windows chokes on. (Can't have a ':' in a
>> filename? Madness!)
>>
>
> That sounds promising. Possibly port to windows too... maybe a way
> windows users can get around network restrictions in some editions of
> the license?
Cheers,
Cliff
More information about the NZLUG
mailing list