# "Implementing CIFS"

## dE_logics

I know nothing about SMB or CIFS (but I do know about NFS), and would like to know about it to implement SAMBA (I'm basically asking for books and/or references (any type, free, non-free etc... )

Unfortunately the modern internet is riddled with 'howto's and no real reference, something which I'm looking forward to.

I've found a few PDFs and articles but they sound outdated.

----------

## gerdesj

Well, let's start with what you actually want to do with it.  You have not actually asked a question ...

eg: I have some Win Vista machines and I want to use a Linux box as a file server or I want to access files on a Win 2008 R2 server from my Linux box or I want to join my Linux box to an AD and login to it over SSH using domain credentials and have a home dir created on the fly.

I can answer all of those and more so come on give us a problem!

Cheers

Jon

----------

## dE_logics

Question updated.

Also does CIFS still user Netbios?

----------

## dE_logics

 *gerdesj wrote:*   

> Well, let's start with what you actually want to do with it.  You have not actually asked a question ...
> 
> eg: I have some Win Vista machines and I want to use a Linux box as a file server or I want to access files on a Win 2008 R2 server from my Linux box or I want to join my Linux box to an AD and login to it over SSH using domain credentials and have a home dir created on the fly.
> 
> I can answer all of those and more so come on give us a problem!
> ...

 

From where did you learn CIFS?

----------

## dE_logics

Ok, so I'm forced to learn from a 150 paged book which has the protocol in detail. I think I don't need to learn all that.

----------

## kimmie

http://www.samba.org

----------

## gerdesj

 *dE_logics wrote:*   

> 
> 
> From where did you learn CIFS?

 

Sorry for the delay in answering.

I learned by having problems to solve on a 6000 PC network and many more rather smaller ones over the past 15 years or so.

I'd recommend getting SWAT running on a system and then following the doc links on the front page - there are loads and some of it is not up to date.  Read the free O'Reilly Using Samba book - it has some good advice.  Its included in the distro and should be linked from SWAT.

The biggest problems I usually see from people is confusing how permissions work and before that how users map from Samba to Unix.  Oh and throw in a general confusion about NetBIOS workgroup browsing and how Kerberos fits in to AD (generally MCSEs suffer from this)

My greatest source of info was via Google to be honest and most of the answers came from forums like these and wikis.

If you have a specific problem to solve then post away.  You never know, you might get a better response than http://www.samba.org - I'll certainly have a bash.

Cheers

Jon

----------

## dE_logics

Ok, thanks, I guess I need to master the protocols internals to clear the confusion.

----------

## dE_logics

I'm having confusion over this netbios thing.

So netbios in CIFS is completely optional, however it's still commonly used? I mean that's how you set the list of servers names (netbios names) in a work group?

Till date I've not seen an CIFS/SMB implementation without these netbios names, it appears to be an integral part of CIFS... however wiki states it's optional.

So if it's optional, and suppose I make a samba server which does not use NetBIOS name resolution, how will the Windows client see the share?

----------

## kimmie

Yeah, I agree, it's very confusing. I don't know why it's so hard to find a clear description, either from microsoft or otherwise. The wikipedia page for SMB is quite informative, though. In short, the impact of disabling netbios on a samba server is pretty much the same as if you disable it on a windows server: this post gives a rough overview.

Some more detail, from my experience:

The key point is that NetBIOS has more than one function... there's NetBIOS broadcast name resolution (using broadcast and port 138, I think, I forget exactly what does what between 137/8/9) and then there's the SMB protocol over netbios session transport, using port 139.

Network browsing (ie. viewing available workgroups/servers) from windows clients uses netbios names, so if you disable netbios altogether, your clients won't be able to see your server in "Windows Network" or "Workgroup" or whatever it's called. But the clients will be able to find the share by name as long as name resolution is set up correctly on your network... so you can just type \\server\share... into windows explorer log in to and the share.

This means that if you don't have a functioning DNS (or correctly maintained hosts files) on your network, you shouldn't disable netbios.

On the other hand, a cool thing you can do is to have normal linux name resolution use netbios. This works well on mixed OS home networks without a DNS server. To do this, emerge samba enabling the winbind USE flag, and change the hosts: line in /etc/nsswitch.conf to read "hosts: files dns wins". This will allow your linux boxen to find your windows machines, as well as vice-versa (as long as you linux machines are running nmbd - smbd isn't needed). Once again, there's more naming confusion: the "wins" in /etc/nsswitch means that the resolver uses libnss_wins.so to do lookups (which does WINS lookups if configured in smb.conf, but ALSO netbios via broadcast) and the USE=winbind flag is needed so this library gets built. It also causes the winbindd daemon (the WINS server) to get built, but you don't have to run it.

Clients will use the SMB protocol over TCP on port 445 for samba sessions, if it's available, instead of the less efficient SMB over NetBIOS over TCP on port 139, regardless of whether NetBIOS is enabled.

But if you wish to do fancy things like have "multiple personality" samba servers, using "netbios aliases = ..." and "include = .. %L/%m" (sort of like samba name-based virtual hosts) you have to use netbios and additionally disable port 445 (use "ports = 139"), because the protocol doesn't pass the netbios names over port 445.

I've got no experience with more complex configurations using domain controllers or active directory, although I don't see why the name resolution/transport issues wouldn't be the same. I don't know if browsing works differently with a domain.

One thing I've found with samba is that there seem to be performance or browseing issues which pop up from time to time and which can be hard to solve - it can end up being a combination of server and client versions, and there's more than one client (eg. for linux clients there's kernel CIFS vs smbclient vs gnome gvfs). Most of the time, it works nicely.

Your best bet is just to try it out and see... it's much easier to get help with a specific question to do with a problem you're having rather than with the general stuff. Sorry about my shortness the first time, hopefully I've made up for it   :Smile: 

----------

## dE_logics

I think CIFS is a horrible protocol with horrible performance like all MS things.

----------

