From ff78c3bf5c3a73cf90f6517d9b2d6b8c12d22d68 Mon Sep 17 00:00:00 2001
From: Jelmer Vernooij
This book is a collection of HOWTOs added to Samba documentation over the years. I try to ensure that all are current, but sometimes the is a larger job @@ -59,6 +59,11 @@ on the "Documentation" page. Please send updates to jerry@samba.org or +jelmer@samba.org.
This documentation is distributed under the GNU General Public License (GPL) @@ -79,7 +84,7 @@ CLASS="TOC" >
This document should be read in conjunction with Browsing and may +be taken as the fast track guide to implementing browsing across subnets +and / or across workgroups (or domains). WINS is the best tool for resolution +of NetBIOS names to IP addesses. WINS is NOT involved in browse list handling +except by way of name to address mapping.
SMB networking provides a mechanism by which clients can access a list -of machines in a network, a so-called "browse list". This list -contains machines that are ready to offer file and/or print services -to other machines within the network. Thus it does not include -machines which aren't currently able to do server tasks. The browse -list is heavily used by all SMB clients. Configuration of SMB -browsing has been problematic for some Samba users, hence this -document.
Firstly, all MS Windows networking is based on SMB (Server Message +Block) based messaging. SMB messaging is implemented using NetBIOS. Samba +implements NetBIOS by encapsulating it over TCP/IP. MS Windows products can +do likewise. NetBIOS based networking uses broadcast messaging to affect +browse list management. When running NetBIOS over TCP/IP this uses UDP +based messaging. UDP messages can be broadcast or unicast.Browsing will NOT work if name resolution from NetBIOS names to IP -addresses does not function correctly. Use of a WINS server is highly -recommended to aid the resolution of NetBIOS (SMB) names to IP addresses. -WINS allows remote segment clients to obtain NetBIOS name_type information -that can NOT be provided by any other means of name resolution.
Normally, only unicast UDP messaging can be forwarded by routers. The +"remote announce" parameter to smb.conf helps to project browse announcements +to remote network segments via unicast UDP. Similarly, the "remote browse sync" +parameter of smb.conf implements browse list collation using unicast UDP.Secondly, in those networks where Samba is the only SMB server technology +wherever possible nmbd should be configured on one (1) machine as the WINS +server. This makes it easy to manage the browsing environment. If each network +segment is configured with it's own Samba WINS server, then the only way to +get cross segment browsing to work is by using the "remote announce" and +the "remote browse sync" parameters to your smb.conf file.
If only one WINS server is used then the use of the "remote announce" and the +"remote browse sync" parameters should NOT be necessary.
Samba WINS does not support MS-WINS replication. This means that when setting up +Samba as a WINS server there must only be one nmbd configured as a WINS server +on the network. Some sites have used multiple Samba WINS servers for redundancy +(one server per subnet) and then used "remote browse sync" and "remote announce" +to affect browse list collation across all segments. Note that this means +clients will only resolve local names, and must be configured to use DNS to +resolve names on other subnets in order to resolve the IP addresses of the +servers they can see on other subnets. This setup is not recommended, but is +mentioned as a practical consideration (ie: an 'if all else fails' scenario).
Lastly, take note that browse lists are a collection of unreliable broadcast +messages that are repeated at intervals of not more than 15 minutes. This means +that it will take time to establish a browse list and it can take up to 45 +minutes to stabilise, particularly across network segments.
Samba now fully supports browsing. The browsing is supported by nmbd -and is also controlled by options in the smb.conf file (see smb.conf(5)).
Samba can act as a local browse master for a workgroup and the ability -for samba to support domain logons and scripts is now available. See -DOMAIN.txt for more information on domain logons.
Samba can also act as a domain master browser for a workgroup. This -means that it will collate lists from local browse masters into a -wide area network server list. In order for browse clients to -resolve the names they may find in this list, it is recommended that -both samba and your clients use a WINS server.
Note that you should NOT set Samba to be the domain master for a -workgroup that has the same name as an NT Domain: on each wide area -network, you must only ever have one domain master browser per workgroup, -regardless of whether it is NT, Samba or any other type of domain master -that is providing this service.
2.2. Use of the "Remote Announce" parameter[Note that nmbd can be configured as a WINS server, but it is not -necessary to specifically use samba as your WINS server. NTAS can -be configured as your WINS server. In a mixed NT server and -samba environment on a Wide Area Network, it is recommended that -you use the NT server's WINS server capabilities. In a samba-only -environment, it is recommended that you use one and only one nmbd -as your WINS server].
The "remote announce" parameter of smb.conf can be used to forcibly ensure +that all the NetBIOS names on a network get announced to a remote network. +The syntax of the "remote announce" parameter is: +remote announce = a.b.c.d [e.f.g.h] ...+_or_ +
remote announce = a.b.c.d/WORKGROUP [e.f.g.h/WORKGROUP] ...+ +where: +
To get browsing to work you need to run nmbd as usual, but will need -to use the "workgroup" option in smb.conf to control what workgroup -Samba becomes a part of.
is either the LMB (Local Master Browser) IP address +or the broadcst address of the remote network. +ie: the LMB is at 192.168.1.10, or the address +could be given as 192.168.1.255 where the netmask +is assumed to be 24 bits (255.255.255.0). +When the remote announcement is made to the broadcast +address of the remote network every host will receive +our announcements. This is noisy and therefore +undesirable but may be necessary if we do NOT know +the IP address of the remote LMB.Samba also has a useful option for a Samba server to offer itself for -browsing on another subnet. It is recommended that this option is only -used for 'unusual' purposes: announcements over the internet, for -example. See "remote announce" in the smb.conf man page.
is optional and can be either our own workgroup +or that of the remote network. If you use the +workgroup name of the remote network then our +NetBIOS machine names will end up looking like +they belong to that workgroup, this may cause +name resolution problems and should be avoided.If something doesn't work then hopefully the log.nmb file will help -you track down the problem. Try a debug level of 2 or 3 for finding -problems. Also note that the current browse list usually gets stored -in text form in a file called browse.dat.
The "remote browse sync" parameter of smb.conf is used to announce to +another LMB that it must synchronise it's NetBIOS name list with our +Samba LMB. It works ONLY if the Samba server that has this option is +simultaneously the LMB on it's network segment.Note that if it doesn't work for you, then you should still be able to -type the server name as \\SERVER in filemanager then hit enter and -filemanager should display the list of available shares.
The syntax of the "remote browse sync" parameter is: + +remote browse sync = a.b.c.d+ +where a.b.c.d is either the IP address of the remote LMB or else is the network broadcast address of the remote segment.
Some people find browsing fails because they don't have the global -"guest account" set to a valid account. Remember that the IPC$ -connection that lists the shares is done as guest, and thus you must -have a valid guest account.
Use of WINS (either Samba WINS _or_ MS Windows NT Server WINS) is highly +recommended. Every NetBIOS machine registers it's name together with a +name_type value for each of of several types of service it has available. +eg: It registers it's name directly as a unique (the type 0x03) name. +It also registers it's name if it is running the lanmanager compatible +server service (used to make shares and printers available to other users) +by registering the server (the type 0x20) name.Also, a lot of people are getting bitten by the problem of too many -parameters on the command line of nmbd in inetd.conf. This trick is to -not use spaces between the option and the parameter (eg: -d2 instead -of -d 2), and to not use the -B and -N options. New versions of nmbd -are now far more likely to correctly find your broadcast and network -address, so in most cases these aren't needed.
All NetBIOS names are up to 15 characters in length. The name_type variable +is added to the end of the name - thus creating a 16 character name. Any +name that is shorter than 15 characters is padded with spaces to the 15th +character. ie: All NetBIOS names are 16 characters long (including the +name_type information).The other big problem people have is that their broadcast address, -netmask or IP address is wrong (specified with the "interfaces" option -in smb.conf)
WINS can store these 16 character names as they get registered. A client +that wants to log onto the network can ask the WINS server for a list +of all names that have registered the NetLogon service name_type. This saves +broadcast traffic and greatly expedites logon processing. Since broadcast +name resolution can not be used across network segments this type of +information can only be provided via WINS _or_ via statically configured +"lmhosts" files that must reside on all clients in the absence of WINS.WINS also serves the purpose of forcing browse list synchronisation by all +LMB's. LMB's must synchronise their browse list with the DMB (domain master +browser) and WINS helps the LMB to identify it's DMB. By definition this +will work only within a single workgroup. Note that the domain master browser +has NOTHING to do with what is referred to as an MS Windows NT Domain. The +later is a reference to a security environment while the DMB refers to the +master controller for browse list information only.
Use of WINS will work correctly only if EVERY client TCP/IP protocol stack +has been configured to use the WINS server/s. Any client that has not been +configured to use the WINS server will continue to use only broadcast based +name registration so that WINS may NEVER get to know about it. In any case, +machines that have not registered with a WINS server will fail name to address +lookup attempts by other clients and will therefore cause workstation access +errors.
To configure Samba as a WINS server just add "wins support = yes" to the +smb.conf file [globals] section.
To configure Samba to register with a WINS server just add +"wins server = a.b.c.d" to your smb.conf file [globals] section.
DO NOT EVER use both "wins support = yes" together with "wins server = a.b.c.d" +particularly not using it's own IP address.
With the release of Samba 1.9.17(alpha1 and above) Samba has been -updated to enable it to support the replication of browse lists -across subnet boundaries. New code and options have been added to -achieve this. This section describes how to set this feature up -in different settings.
A very common cause of browsing problems results from installing more than +one protocol on an MS Windows machine.To see browse lists that span TCP/IP subnets (ie. networks separated -by routers that don't pass broadcast traffic) you must set up at least -one WINS server. The WINS server acts as a DNS for NetBIOS names, allowing -NetBIOS name to IP address translation to be done by doing a direct -query of the WINS server. This is done via a directed UDP packet on -port 137 to the WINS server machine. The reason for a WINS server is -that by default, all NetBIOS name to IP address translation is done -by broadcasts from the querying machine. This means that machines -on one subnet will not be able to resolve the names of machines on -another subnet without using a WINS server.
Every NetBIOS machine take part in a process of electing the LMB (and DMB) +every 15 minutes. A set of election criteria is used to determine the order +of precidence for winning this election process. A machine running Samba or +Windows NT will be biased so that the most suitable machine will predictably +win and thus retain it's role.Remember, for browsing across subnets to work correctly, all machines, -be they Windows 95, Windows NT, or Samba servers must have the IP address -of a WINS server given to them by a DHCP server, or by manual configuration -(for Win95 and WinNT, this is in the TCP/IP Properties, under Network -settings) for Samba this is in the smb.conf file.
The election process is "fought out" so to speak over every NetBIOS network +interface. In the case of a Windows 9x machine that has both TCP/IP and IPX +installed and has NetBIOS enabled over both protocols the election will be +decided over both protocols. As often happens, if the Windows 9x machine is +the only one with both protocols then the LMB may be won on the NetBIOS +interface over the IPX protocol. Samba will then lose the LMB role as Windows +9x will insist it knows who the LMB is. Samba will then cease to function +as an LMB and thus browse list operation on all TCP/IP only machines will +fail.The safest rule of all to follow it this - USE ONLY ONE PROTOCOL!
Cross subnet browsing is a complicated dance, containing multiple -moving parts. It has taken Microsoft several years to get the code -that achieves this correct, and Samba lags behind in some areas. -However, with the 1.9.17 release, Samba is capable of cross subnet -browsing when configured correctly.
2.6. Name Resolution OrderConsider a network set up as follows :
Resolution of NetBIOS names to IP addresses can take place using a number +of methods. The only ones that can provide NetBIOS name_type information +are:(DMB) - N1_A N1_B N1_C N1_D N1_E - | | | | | - ------------------------------------------------------- - | subnet 1 | - +---+ +---+ - |R1 | Router 1 Router 2 |R2 | - +---+ +---+ - | | - | subnet 2 subnet 3 | - -------------------------- ------------------------------------ - | | | | | | | | - N2_A N2_B N2_C N2_D N3_A N3_B N3_C N3_D - (WINS)
WINS: the best tool! |
LMHOSTS: is static and hard to maintain. |
Broadcast: uses UDP and can not resolve names across remote segments. |
Consisting of 3 subnets (1, 2, 3) connected by two routers -(R1, R2) - these do not pass broadcasts. Subnet 1 has 5 machines -on it, subnet 2 has 4 machines, subnet 3 has 4 machines. Assume -for the moment that all these machines are configured to be in the -same workgroup (for simplicities sake). Machine N1_C on subnet 1 -is configured as Domain Master Browser (ie. it will collate the -browse lists for the workgroup). Machine N2_D is configured as -WINS server and all the other machines are configured to register -their NetBIOS names with it.
As all these machines are booted up, elections for master browsers -will take place on each of the three subnets. Assume that machine -N1_C wins on subnet 1, N2_B wins on subnet 2, and N3_D wins on -subnet 3 - these machines are known as local master browsers for -their particular subnet. N1_C has an advantage in winning as the -local master browser on subnet 1 as it is set up as Domain Master -Browser.
Alternative means of name resolution includes:On each of the three networks, machines that are configured to -offer sharing services will broadcast that they are offering -these services. The local master browser on each subnet will -receive these broadcasts and keep a record of the fact that -the machine is offering a service. This list of records is -the basis of the browse list. For this case, assume that -all the machines are configured to offer services so all machines -will be on the browse list.
For each network, the local master browser on that network is -considered 'authoritative' for all the names it receives via -local broadcast. This is because a machine seen by the local -master browser via a local broadcast must be on the same -network as the local master browser and thus is a 'trusted' -and 'verifiable' resource. Machines on other networks that -the local master browsers learn about when collating their -browse lists have not been directly seen - these records are -called 'non-authoritative'.
At this point the browse lists look as follows (these are -the machines you would see in your network neighborhood if -you looked in it on a particular network right now).
Subnet Browse Master List ------- ------------- ---- -Subnet1 N1_C N1_A, N1_B, N1_C, N1_D, N1_E - -Subnet2 N2_B N2_A, N2_B, N2_C, N2_D - -Subnet3 N3_D N3_A, N3_B, N3_C, N3_D
/etc/hosts: is static, hard to maintain, and lacks name_type info |
DNS: is a good choice but lacks essential name_type info. |
Note that at this point all the subnets are separate, no -machine is seen across any of the subnets.
Now examine subnet 2. As soon as N2_B has become the local -master browser it looks for a Domain master browser to synchronize -its browse list with. It does this by querying the WINS server -(N2_D) for the IP address associated with the NetBIOS name -WORKGROUP>1B<. This name was registerd by the Domain master -browser (N1_C) with the WINS server as soon as it was booted.
Once N2_B knows the address of the Domain master browser it -tells it that is the local master browser for subnet 2 by -sending a MasterAnnouncement packet as a UDP port 138 packet. -It then synchronizes with it by doing a NetServerEnum2 call. This -tells the Domain Master Browser to send it all the server -names it knows about. Once the domain master browser receives -the MasterAnnouncement packet it schedules a synchronization -request to the sender of that packet. After both synchronizations -are done the browse lists look like :
Subnet Browse Master List ------- ------------- ---- -Subnet1 N1_C N1_A, N1_B, N1_C, N1_D, N1_E, - N2_A(*), N2_B(*), N2_C(*), N2_D(*) - -Subnet2 N2_B N2_A, N2_B, N2_C, N2_D - N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*) - -Subnet3 N3_D N3_A, N3_B, N3_C, N3_D - -Servers with a (*) after them are non-authoritative names.
At this point users looking in their network neighborhood on -subnets 1 or 2 will see all the servers on both, users on -subnet 3 will still only see the servers on their own subnet.
The same sequence of events that occured for N2_B now occurs -for the local master browser on subnet 3 (N3_D). When it -synchronizes browse lists with the domain master browser (N1_A) -it gets both the server entries on subnet 1, and those on -subnet 2. After N3_D has synchronized with N1_C and vica-versa -the browse lists look like.
Many sites want to restrict DNS lookups and want to avoid broadcast name +resolution traffic. The "name resolve order" parameter is of great help here. +The syntax of the "name resolve order" parameter is: ++The default is: +Subnet Browse Master List ------- ------------- ---- -Subnet1 N1_C N1_A, N1_B, N1_C, N1_D, N1_E, - N2_A(*), N2_B(*), N2_C(*), N2_D(*), - N3_A(*), N3_B(*), N3_C(*), N3_D(*) - -Subnet2 N2_B N2_A, N2_B, N2_C, N2_D - N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*) - -Subnet3 N3_D N3_A, N3_B, N3_C, N3_D - N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*), - N2_A(*), N2_B(*), N2_C(*), N2_D(*) - -Servers with a (*) after them are non-authoritative names.At this point users looking in their network neighborhood on -subnets 1 or 3 will see all the servers on all sunbets, users on -subnet 2 will still only see the servers on subnets 1 and 2, but not 3.
Finally, the local master browser for subnet 2 (N2_B) will sync again -with the domain master browser (N1_C) and will recieve the missing -server entries. Finally - and as a steady state (if no machines -are removed or shut off) the browse lists will look like :
name resolve order = wins lmhosts bcast host+_or_ +Subnet Browse Master List ------- ------------- ---- -Subnet1 N1_C N1_A, N1_B, N1_C, N1_D, N1_E, - N2_A(*), N2_B(*), N2_C(*), N2_D(*), - N3_A(*), N3_B(*), N3_C(*), N3_D(*) - -Subnet2 N2_B N2_A, N2_B, N2_C, N2_D - N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*) - N3_A(*), N3_B(*), N3_C(*), N3_D(*) - -Subnet3 N3_D N3_A, N3_B, N3_C, N3_D - N1_A(*), N1_B(*), N1_C(*), N1_D(*), N1_E(*), - N2_A(*), N2_B(*), N2_C(*), N2_D(*) - -Servers with a (*) after them are non-authoritative names.Synchronizations between the domain master browser and local -master browsers will continue to occur, but this should be a -steady state situation.
If either router R1 or R2 fails the following will occur:
- name resolve order = wins lmhosts (eliminates bcast and host)
name resolve order = host lmhost wins bcast. +where "host" refers the the native methods used by the Unix system +to implement the gethostbyname() function call. This is normally +controlled by /etc/host.conf, /etc/nsswitch.conf and /etc/resolv.conf.
Names of computers on each side of the inaccessible network fragments - will be maintained for as long as 36 minutes, in the network neighbourhood - lists. +>Old windows clients send plain text passwords over the wire. + Samba can check these passwords by crypting them and comparing them + to the hash stored in the unix user database.
Attempts to connect to these inaccessible computers will fail, but the - names will not be removed from the network neighbourhood lists. +> Newer windows clients send encrypted passwords (so-called + Lanman and NT hashes) over + the wire, instead of plain text passwords. The newest clients + will only send encrypted passwords and refuse to send plain text + passwords, unless their registry is tweaked.
If one of the fragments is cut off from the WINS server, it will only - be able to access servers on its local subnet, by using subnet-isolated - broadcast NetBIOS name resolution. The effects are similar to that of - losing access to a DNS server. +>These passwords can't be converted to unix style encrypted + passwords. Because of that you can't use the standard unix + user database, and you have to store the Lanman and NT hashes + somewhere else.
Next to a differently encrypted passwords, + windows also stores certain data for each user + that is not stored in a unix user database, e.g. + workstations the user may logon from, the location where his/her + profile is stored, etc. + Samba retrieves and stores this information using a "passdb backend". + Commonly + available backends are LDAP, plain text file, MySQL and nisplus. + For more information, see the documentation about the + passdb backend = parameter.
Either a Samba machine or a Windows NT Server machine may be set up -as a WINS server. To set a Samba machine to be a WINS server you must -add the following option to the smb.conf file on the selected machine : -in the [globals] section add the line
3.2. Important Notes About Securitywins support = yes
The unix and SMB password encryption techniques seem similar + on the surface. This similarity is, however, only skin deep. The unix + scheme typically sends clear text passwords over the network when + logging in. This is bad. The SMB encryption scheme never sends the + cleartext password over the network but it does store the 16 byte + hashed values on disk. This is also bad. Why? Because the 16 byte hashed + values are a "password equivalent". You cannot derive the user's + password from them, but they could potentially be used in a modified + client to gain access to a server. This would require considerable + technical knowledge on behalf of the attacker but is perfectly possible. + You should thus treat the data stored in whatever + passdb backend you use (smbpasswd file, ldap, mysql) as though it contained the + cleartext passwords of all your users. Its contents must be kept + secret, and the file should be protected accordingly.Versions of Samba previous to 1.9.17 had this parameter default to -yes. If you have any older versions of Samba on your network it is -strongly suggested you upgrade to 1.9.17 or above, or at the very -least set the parameter to 'no' on all these machines.
Ideally we would like a password scheme which neither requires + plain text passwords on the net or on disk. Unfortunately this + is not available as Samba is stuck with being compatible with + other SMB systems (WinNT, WfWg, Win95 etc).Machines with "wins support = yes" will keep a list of -all NetBIOS names registered with them, acting as a DNS for NetBIOS names.
You should set up only ONE wins server. Do NOT set the -"wins support = yes" option on more than one Samba -server. To set up a Windows NT Server as a WINS server you need to set up -the WINS service - see your NT documentation for details. Note that -Windows NT WINS Servers can replicate to each other, allowing more -than one to be set up in a complex subnet environment. As Microsoft -refuse to document these replication protocols Samba cannot currently -participate in these replications. It is possible in the future that -a Samba->Samba WINS replication protocol may be defined, in which -case more than one Samba machine could be set up as a WINS server -but currently only one Samba server should have the "wins support = yes" -parameter set. Note that Windows NT 4.0 Service pack 3 changed the + default for permissible authentication so that plaintext + passwords are never sent over the wire. + The solution to this is either to switch to encrypted passwords + with Samba or edit the Windows NT registry to re-enable plaintext + passwords. See the document WinNT.txt for details on how to do + this.After the WINS server has been configured you must ensure that all -machines participating on the network are configured with the address -of this WINS server. If your WINS server is a Samba machine, fill in -the Samba machine IP address in the "Primary WINS Server" field of -the "Control Panel->Network->Protocols->TCP->WINS Server" dialogs -in Windows 95 or Windows NT. To tell a Samba server the IP address -of the WINS server add the following line to the [global] section of -all smb.conf files : Other Microsoft operating systems which also exhibit + this behavior includeswins server = >name or IP address<
where >name or IP address< is either the DNS name of the WINS server -machine or its IP address. Note that this line MUST NOT BE SET in the smb.conf file of the Samba -server acting as the WINS server itself. If you set both the -"wins support = yes" option and the -"wins server = >name<" option then -nmbd will fail to start. There are two possible scenarios for setting up cross subnet browsing. -The first details setting up cross subnet browsing on a network containing -Windows 95, Samba and Windows NT machines that are not configured as -part of a Windows NT Domain. The second details setting up cross subnet -browsing on networks that contain NT Domains. Note :All current release of + Microsoft SMB/CIFS clients support authentication via the + SMB Challenge/Response mechanism described here. Enabling + clear text authentication does not disable the ability + of the client to participate in encrypted authentication. |
To set up cross subnet browsing on a network containing machines -in up to be in a WORKGROUP, not an NT Domain you need to set up one -Samba server to be the Domain Master Browser (note that this is *NOT* -the same as a Primary Domain Controller, although in an NT Domain the -same machine plays both roles). The role of a Domain master browser is -to collate the browse lists from local master browsers on all the -subnets that have a machine participating in the workgroup. Without -one machine configured as a domain master browser each subnet would -be an isolated workgroup, unable to see any machines on any other -subnet. It is the presense of a domain master browser that makes -cross subnet browsing possible for a workgroup.
In an WORKGROUP environment the domain master browser must be a -Samba server, and there must only be one domain master browser per -workgroup name. To set up a Samba server as a domain master browser, -set the following option in the [global] section of the smb.conf file :
domain master = yes
The domain master browser should also preferrably be the local master -browser for its own subnet. In order to achieve this set the following -options in the [global] section of the smb.conf file :
domain master = yes - local master = yes - preferred master = yes - os level = 65
The domain master browser may be the same machine as the WINS -server, if you require.
Next, you should ensure that each of the subnets contains a -machine that can act as a local master browser for the -workgroup. Any NT machine should be able to do this, as will -Windows 95 machines (although these tend to get rebooted more -often, so it's not such a good idea to use these). To make a -Samba server a local master browser set the following -options in the [global] section of the smb.conf file :
3.2.1. Advantages of SMB Encryptiondomain master = no - local master = yes - preferred master = yes - os level = 65
plain text passwords are not passed across + the network. Someone using a network sniffer cannot just + record passwords going to the SMB server. |
WinNT doesn't like talking to a server + that isn't using SMB encrypted passwords. It will refuse + to browse the server if the server is also in user level + security mode. It will insist on prompting the user for the + password on each connection, which is very annoying. The + only things you can do to stop this is to use SMB encryption. + |
Do not do this for more than one Samba server on each subnet, -or they will war with each other over which is to be the local -master browser.
The "local master" parameter allows Samba to act as a local master -browser. The "preferred master" causes nmbd to force a browser -election on startup and the "os level" parameter sets Samba high -enough so that it should win any browser elections.
If you have an NT machine on the subnet that you wish to -be the local master browser then you can disable Samba from -becoming a local master browser by setting the following -options in the [global] section of the smb.conf file :
domain master = no - local master = no - preferred master = no - os level = 0
If you are adding Samba servers to a Windows NT Domain then -you must not set up a Samba server as a domain master browser. -By default, a Windows NT Primary Domain Controller for a Domain -name is also the Domain master browser for that name, and many -things will break if a Samba server registers the Domain master -browser NetBIOS name (DOMAIN>1B<) with WINS instead of the PDC.
For subnets other than the one containing the Windows NT PDC -you may set up Samba servers as local master browsers as -described. To make a Samba server a local master browser set -the following options in the [global] section of the smb.conf -file :
3.2.2. Advantages of non-encrypted passwordsdomain master = no - local master = yes - preferred master = yes - os level = 65
plain text passwords are not kept + on disk. |
uses same password file as other unix + services such as login and ftp |
you are probably already using other + services (such as telnet and ftp) which send plain text + passwords over the net, so sending them for SMB isn't + such a big deal. |
If you wish to have a Samba server fight the election with machines -on the same subnet you may set the "os level" parameter to lower -levels. By doing this you can tune the order of machines that -will become local master browsers if they are running. For -more details on this see the section "FORCING SAMBA TO BE THE MASTER" -below.
If you have Windows NT machines that are members of the domain -on all subnets, and you are sure they will always be running then -you can disable Samba from taking part in browser elections and -ever becoming a local master browser by setting following options -in the [global] section of the smb.conf file :
domain master = no - local master = no - preferred master = no - os level = 0
Who becomes the "master browser" is determined by an election process -using broadcasts. Each election packet contains a number of parameters -which determine what precedence (bias) a host should have in the -election. By default Samba uses a very low precedence and thus loses -elections to just about anyone else.
If you want Samba to win elections then just set the "os level" global -option in smb.conf to a higher number. It defaults to 0. Using 34 -would make it win all elections over every other system (except other -samba systems!)
A "os level" of 2 would make it beat WfWg and Win95, but not NTAS. A -NTAS domain controller uses level 32.
The maximum os level is 255
If you want samba to force an election on startup, then set the -"preferred master" global option in smb.conf to "yes". Samba will -then have a slight advantage over other potential master browsers -that are not preferred master browsers. Use this parameter with -care, as if you have two hosts (whether they are windows 95 or NT or -samba) on the same local subnet both set with "preferred master" to -"yes", then periodically and continually they will force an election -in order to become the local master browser.
If you want samba to be a "domain master browser", then it is -recommended that you also set "preferred master" to "yes", because -samba will not become a domain master browser for the whole of your -LAN or WAN if it is not also a local master browser on its own -broadcast isolated subnet.
It is possible to configure two samba servers to attempt to become -the domain master browser for a domain. The first server that comes -up will be the domain master browser. All other samba servers will -attempt to become the domain master browser every 5 minutes. They -will find that another samba server is already the domain master -browser and will fail. This provides automatic redundancy, should -the current domain master browser fail.
The domain master is responsible for collating the browse lists of -multiple subnets so that browsing can occur between subnets. You can -make samba act as the domain master by setting "domain master = yes" -in smb.conf. By default it will not be a domain master.
smbpasswd works in a client-server mode + where it contacts the local smbd to change the user's password on its + behalf. This has enormous benefits - as follows.Note that you should NOT set Samba to be the domain master for a -workgroup that has the same name as an NT Domain.
smbpasswd has the capability + to change passwords on Windows NT servers (this only works when + the request is sent to the NT Primary Domain Controller if you + are changing an NT Domain user's password).When samba is the domain master and the master browser it will listen -for master announcements (made roughly every twelve minutes) from local -master browsers on other subnets and then contact them to synchronise -browse lists.
To run smbpasswd as a normal user just type :If you want samba to be the domain master then I suggest you also set -the "os level" high enough to make sure it wins elections, and set -"preferred master" to "yes", to get samba to force an election on -startup.
$ smbpasswdNote that all your servers (including samba) and clients should be -using a WINS server to resolve NetBIOS names. If your clients are only -using broadcasting to resolve NetBIOS names, then two things will occur:
Old SMB password: <type old value here - + or hit return if there was no old password>New SMB Password: <type new value> +
your local master browsers will be unable to find a domain master - browser, as it will only be looking on the local subnet. -
if a client happens to get hold of a domain-wide browse list, and - a user attempts to access a host in that list, it will be unable to - resolve the NetBIOS name of that host. -
If, however, both samba and your clients are using a WINS server, then:
If invoked by an ordinary user it will only allow the user + to change his or her own Samba password.your local master browsers will contact the WINS server and, as long as - samba has registered that it is a domain master browser with the WINS - server, your local master browser will receive samba's ip address - as its domain master browser. -
when a client receives a domain-wide browse list, and a user attempts - to access a host in that list, it will contact the WINS server to - resolve the NetBIOS name of that host. as long as that host has - registered its NetBIOS name with the same WINS server, the user will - be able to see that host. -
If your network uses a "0" based broadcast address (for example if it -ends in a 0) then you will strike problems. Windows for Workgroups -does not seem to support a 0's broadcast and you will probably find -that browsing and name lookups won't work.
Older versions of samba retrieved user information from the unix user database +and eventually some other fields from the file /etc/samba/smbpasswd +or /etc/smbpasswd. When password encryption is disabled, no +data is stored at all.Samba now supports machines with multiple network interfaces. If you -have multiple interfaces then you will need to use the "interfaces" -option in smb.conf to configure them. See smb.conf(5) for details.
Samba can also store the user data in a "TDB" (Trivial Database). Using this backend +doesn't require any additional configuration. This backend is recommended for new installations who +don't require LDAP.When a client opens a file it can request an "oplock" or file -lease. This is (to simplify a bit) a guarentee that no one else -has the file open simultaneously. It allows the client to not -send any updates on the file to the server, thus reducing a -network file access to local access (once the file is in -client cache). An "oplock break" is when the server sends -a request to the client to flush all its changes back to -the server, so the file is in a consistent state for other -opens to succeed. If a client fails to respond to this -asynchronous request then the file can be corrupted. Hence -the "turn off oplocks" answer if people are having multi-user -file access problems.
Unless the kernel is "oplock aware" (SGI IRIX and Linux are -the only two UNIXes that are at the moment) then if a local -UNIX process accesses the file simultaneously then Samba -has no way of telling this is occuring, so the guarentee -to the client is broken. This can corrupt the file. Short -answer - it you have UNIX clients accessing the same file -as smbd locally or via NFS and you're not running Linux or -IRIX then turn off oplocks for that file or share.
"Share modes". These are modes of opening a file, that -guarentee an invarient - such as DENY_WRITE - which means -that if any other opens are requested with write access after -this current open has succeeded then they should be denied -with a "sharing violation" error message. Samba handles these -internally inside smbd. UNIX clients accessing the same file -ignore these invarients. Just proving that if you need simultaneous -file access from a Windows and UNIX client you *must* have an -application that is written to lock records correctly on both -sides. Few applications are written like this, and even fewer -are cross platform (UNIX and Windows) so in practice this isn't -much of a problem.
"Locking". This really means "byte range locking" - such as -lock 10 bytes at file offset 24 for write access. This is the -area in which well written UNIX and Windows apps will cooperate. -Windows locks (at least from NT or above) are 64-bit unsigned -offsets. UNIX locks are either 31 bit or 63 bit and are signed -(the top bit is used for the sign). Samba handles these by -first ensuring that all the Windows locks don't conflict (ie. -if other Windows clients have competing locks then just reject -immediately) - this allows us to support 64-bit Windows locks -on 32-bit filesystems. Secondly any locks that are valid are -then mapped onto UNIX fcntl byte range locks. These are the -locks that will be seen by UNIX processes. If there is a conflict -here the lock is rejected.
Note that if a client has an oplock then it "knows" that no -other client can have the file open so usually doesn't bother -to send to lock request to the server - this means once again -if you need to share files between UNIX and Windows processes -either use IRIX or Linux, or turn off oplocks for these -files/shares.
This document should be read in conjunction with Browsing and may -be taken as the fast track guide to implementing browsing across subnets -and / or across workgroups (or domains). WINS is the best tool for resolution -of NetBIOS names to IP addesses. WINS is NOT involved in browse list handling -except by way of name to address mapping.
3.6. LDAPFirstly, all MS Windows networking is based on SMB (Server Message -Block) based messaging. SMB messaging is implemented using NetBIOS. Samba -implements NetBIOS by encapsulating it over TCP/IP. MS Windows products can -do likewise. NetBIOS based networking uses broadcast messaging to affect -browse list management. When running NetBIOS over TCP/IP this uses UDP -based messaging. UDP messages can be broadcast or unicast.
This document describes how to use an LDAP directory for storing Samba user +account information traditionally stored in the smbpasswd(5) file. It is +assumed that the reader already has a basic understanding of LDAP concepts +and has a working directory server already installed. For more information +on LDAP architectures and Directories, please refer to the following sites.Normally, only unicast UDP messaging can be forwarded by routers. The -"remote announce" parameter to smb.conf helps to project browse announcements -to remote network segments via unicast UDP. Similarly, the "remote browse sync" -parameter of smb.conf implements browse list collation using unicast UDP.
Secondly, in those networks where Samba is the only SMB server technology -wherever possible nmbd should be configured on one (1) machine as the WINS -server. This makes it easy to manage the browsing environment. If each network -segment is configured with it's own Samba WINS server, then the only way to -get cross segment browsing to work is by using the "remote announce" and -the "remote browse sync" parameters to your smb.conf file.
OpenLDAP - http://www.openldap.org/If only one WINS server is used then the use of the "remote announce" and the -"remote browse sync" parameters should NOT be necessary.
iPlanet Directory Server - http://iplanet.netscape.com/directorySamba WINS does not support MS-WINS replication. This means that when setting up -Samba as a WINS server there must only be one nmbd configured as a WINS server -on the network. Some sites have used multiple Samba WINS servers for redundancy -(one server per subnet) and then used "remote browse sync" and "remote announce" -to affect browse list collation across all segments. Note that this means -clients will only resolve local names, and must be configured to use DNS to -resolve names on other subnets in order to resolve the IP addresses of the -servers they can see on other subnets. This setup is not recommended, but is -mentioned as a practical consideration (ie: an 'if all else fails' scenario).
Note that O'Reilly Publishing is working on +a guide to LDAP for System Administrators which has a planned release date of +early summer, 2002.Lastly, take note that browse lists are a collection of unreliable broadcast -messages that are repeated at intervals of not more than 15 minutes. This means -that it will take time to establish a browse list and it can take up to 45 -minutes to stabilise, particularly across network segments.
Two additional Samba resources which may prove to be helpful areThe Samba-PDC-LDAP-HOWTO + maintained by Ignacio Coupeau.
The NT migration scripts from IDEALX that are + geared to manage users and group in such a Samba-LDAP Domain Controller configuration. +
The "remote announce" parameter of smb.conf can be used to forcibly ensure -that all the NetBIOS names on a network get announced to a remote network. -The syntax of the "remote announce" parameter is: -
remote announce = a.b.c.d [e.f.g.h] ...Traditionally, when configuring "encrypt +passwords = yes" in Samba's smb.conf file, user account +information such as username, LM/NT password hashes, password change times, and account +flags have been stored in the smbpasswd(5) file. There are several +disadvantages to this approach for sites with very large numbers of users (counted +in the thousands).
The first is that all lookups must be performed sequentially. Given that +there are approximately two lookups per domain logon (one for a normal +session connection such as when mapping a network drive or printer), this +is a performance bottleneck for lareg sites. What is needed is an indexed approach +such as is used in databases.
The second problem is that administrators who desired to replicate a +smbpasswd file to more than one Samba server were left to use external +tools such as rsync(1) and ssh(1) -_or_ -
remote announce = a.b.c.d/WORKGROUP [e.f.g.h/WORKGROUP] ...
And finally, the amount of information which is stored in an +smbpasswd entry leaves no room for additional attributes such as +a home directory, password expiration time, or even a Relative +Identified (RID).
As a result of these defeciencies, a more robust means of storing user attributes +used by smbd was developed. The API which defines access to user accounts +is commonly referred to as the samdb interface (previously this was called the passdb +API, and is still so named in the CVS trees). In Samba 2.2.3, enabling support +for a samdb backend (e.g. --with-ldapsam or +--with-tdbsam) requires compile time support.
When compiling Samba to include the --with-ldapsam autoconf +option, smbd (and associated tools) will store and lookup user accounts in +an LDAP directory. In reality, this is very easy to understand. If you are +comfortable with using an smbpasswd file, simply replace "smbpasswd" with +"LDAP directory" in all the documentation.
There are a few points to stress about what the --with-ldapsam - -where: -
is either the LMB (Local Master Browser) IP address -or the broadcst address of the remote network. -ie: the LMB is at 192.168.1.10, or the address -could be given as 192.168.1.255 where the netmask -is assumed to be 24 bits (255.255.255.0). -When the remote announcement is made to the broadcast -address of the remote network every host will receive -our announcements. This is noisy and therefore -undesirable but may be necessary if we do NOT know -the IP address of the remote LMB.
is optional and can be either our own workgroup -or that of the remote network. If you use the -workgroup name of the remote network then our -NetBIOS machine names will end up looking like -they belong to that workgroup, this may cause -name resolution problems and should be avoided.
The second item can be accomplished by using LDAP NSS and PAM modules. LGPL +versions of these libraries can be obtained from PADL Software +(http://www.padl.com/). However, +the details of configuring these packages are beyond the scope of this document.
The "remote browse sync" parameter of smb.conf is used to announce to -another LMB that it must synchronise it's NetBIOS name list with our -Samba LMB. It works ONLY if the Samba server that has this option is -simultaneously the LMB on it's network segment.
3.6.3. Supported LDAP ServersThe syntax of the "remote browse sync" parameter is: -
remote browse sync = a.b.c.d- -where a.b.c.d is either the IP address of the remote LMB or else is the network broadcast address of the remote segment.The LDAP samdb code in 2.2.3 has been developed and tested using the OpenLDAP +2.0 server and client libraries. The same code should be able to work with +Netscape's Directory Server and client SDK. However, due to lack of testing +so far, there are bound to be compile errors and bugs. These should not be +hard to fix. If you are so inclined, please be sure to forward all patches to +samba-patches@samba.org and +jerry@samba.org.
Use of WINS (either Samba WINS _or_ MS Windows NT Server WINS) is highly -recommended. Every NetBIOS machine registers it's name together with a -name_type value for each of of several types of service it has available. -eg: It registers it's name directly as a unique (the type 0x03) name. -It also registers it's name if it is running the lanmanager compatible -server service (used to make shares and printers available to other users) -by registering the server (the type 0x20) name.
Samba 3.0 includes the necessary schema file for OpenLDAP 2.0 in +examples/LDAP/samba.schema. The sambaAccount objectclass is given here:All NetBIOS names are up to 15 characters in length. The name_type variable -is added to the end of the name - thus creating a 16 character name. Any -name that is shorter than 15 characters is padded with spaces to the 15th -character. ie: All NetBIOS names are 16 characters long (including the -name_type information).
objectclass ( 1.3.1.5.1.4.1.7165.2.2.2 NAME 'sambaAccount' SUP top STRUCTURAL + DESC 'Samba Account' + MUST ( uid $ rid ) + MAY ( cn $ lmPassword $ ntPassword $ pwdLastSet $ logonTime $ + logoffTime $ kickoffTime $ pwdCanChange $ pwdMustChange $ acctFlags $ + displayName $ smbHome $ homeDrive $ scriptPath $ profilePath $ + description $ userWorkstations $ primaryGroupID $ domain ))
WINS can store these 16 character names as they get registered. A client -that wants to log onto the network can ask the WINS server for a list -of all names that have registered the NetLogon service name_type. This saves -broadcast traffic and greatly expedites logon processing. Since broadcast -name resolution can not be used across network segments this type of -information can only be provided via WINS _or_ via statically configured -"lmhosts" files that must reside on all clients in the absence of WINS.
WINS also serves the purpose of forcing browse list synchronisation by all -LMB's. LMB's must synchronise their browse list with the DMB (domain master -browser) and WINS helps the LMB to identify it's DMB. By definition this -will work only within a single workgroup. Note that the domain master browser -has NOTHING to do with what is referred to as an MS Windows NT Domain. The -later is a reference to a security environment while the DMB refers to the -master controller for browse list information only.
Use of WINS will work correctly only if EVERY client TCP/IP protocol stack -has been configured to use the WINS server/s. Any client that has not been -configured to use the WINS server will continue to use only broadcast based -name registration so that WINS may NEVER get to know about it. In any case, -machines that have not registered with a WINS server will fail name to address -lookup attempts by other clients and will therefore cause workstation access -errors.
To configure Samba as a WINS server just add "wins support = yes" to the -smb.conf file [globals] section.
The samba.schema file has been formatted for OpenLDAP 2.0. The OID's are +owned by the Samba Team and as such is legal to be openly published. +If you translate the schema to be used with Netscape DS, please +submit the modified schema file as a patch to jerry@samba.orgTo configure Samba to register with a WINS server just add -"wins server = a.b.c.d" to your smb.conf file [globals] section.
Just as the smbpasswd file is mean to store information which supplements a +user's /etc/passwd entry, so is the sambaAccount object +meant to supplement the UNIX user account information. A sambaAccount is a +STRUCTURAL objectclass so it can be stored individually +in the directory. However, there are several fields (e.g. uid) which overlap +with the posixAccount objectclass outlined in RFC2307. This is by design.DO NOT EVER use both "wins support = yes" together with "wins server = a.b.c.d" -particularly not using it's own IP address.
In order to store all user account information (UNIX and Samba) in the directory, +it is necessary to use the sambaAccount and posixAccount objectclasses in +combination. However, smbd will still obtain the user's UNIX account +information via the standard C library calls (e.g. getpwnam(), et. al.). +This means that the Samba server must also have the LDAP NSS library installed +and functioning correctly. This division of information makes it possible to +store all Samba account information in LDAP, but still maintain UNIX account +information in NIS while the network is transitioning to a full LDAP infrastructure.A very common cause of browsing problems results from installing more than -one protocol on an MS Windows machine.
To include support for the sambaAccount object in an OpenLDAP directory +server, first copy the samba.schema file to slapd's configuration directory.Every NetBIOS machine take part in a process of electing the LMB (and DMB) -every 15 minutes. A set of election criteria is used to determine the order -of precidence for winning this election process. A machine running Samba or -Windows NT will be biased so that the most suitable machine will predictably -win and thus retain it's role.
root# cp samba.schema /etc/openldap/schema/The election process is "fought out" so to speak over every NetBIOS network -interface. In the case of a Windows 9x machine that has both TCP/IP and IPX -installed and has NetBIOS enabled over both protocols the election will be -decided over both protocols. As often happens, if the Windows 9x machine is -the only one with both protocols then the LMB may be won on the NetBIOS -interface over the IPX protocol. Samba will then lose the LMB role as Windows -9x will insist it knows who the LMB is. Samba will then cease to function -as an LMB and thus browse list operation on all TCP/IP only machines will -fail.
Next, include the samba.schema file in slapd.conf. +The sambaAccount object contains two attributes which depend upon other schema +files. The 'uid' attribute is defined in cosine.schema and +the 'displayName' attribute is defined in the inetorgperson.schema +file. Both of these must be included before the samba.schema file.The safest rule of all to follow it this - USE ONLY ONE PROTOCOL!
## /etc/openldap/slapd.conf + +## schema files (core.schema is required by default) +include /etc/openldap/schema/core.schema + +## needed for sambaAccount +include /etc/openldap/schema/cosine.schema +include /etc/openldap/schema/inetorgperson.schema +include /etc/openldap/schema/samba.schema + +## uncomment this line if you want to support the RFC2307 (NIS) schema +## include /etc/openldap/schema/nis.schema + +....
It is recommended that you maintain some indices on some of the most usefull attributes, +like in the following example, to speed up searches made on sambaAccount objectclasses +(and possibly posixAccount and posixGroup as well).
# Indices to maintain +## required by OpenLDAP 2.0 +index objectclass eq + +## support pb_getsampwnam() +index uid pres,eq +## support pdb_getsambapwrid() +index rid eq + +## uncomment these if you are storing posixAccount and +## posixGroup entries in the directory as well +##index uidNumber eq +##index gidNumber eq +##index cn eq +##index memberUid eq
The following parameters are available in smb.conf only with --with-ldapsam +was included with compiling Samba.
Resolution of NetBIOS names to IP addresses can take place using a number -of methods. The only ones that can provide NetBIOS name_type information -are: -
WINS: the best tool! |
LMHOSTS: is static and hard to maintain. |
Broadcast: uses UDP and can not resolve names across remote segments. |
These are described in the smb.conf(5) man +page and so will not be repeated here. However, a sample smb.conf file for +use with an LDAP directory could appear as
## /usr/local/samba/lib/smb.conf +[global] + security = user + encrypt passwords = yes + + netbios name = TASHTEGO + workgroup = NARNIA + + # ldap related parameters + + # define the DN to use when binding to the directory servers + # The password for this DN is not stored in smb.conf. Rather it + # must be set by using 'smbpasswd -w secretpw' to store the + # passphrase in the secrets.tdb file. If the "ldap admin dn" values + # changes, this password will need to be reset. + ldap admin dn = "cn=Samba Manager,ou=people,dc=samba,dc=org" + + # specify the LDAP server's hostname (defaults to locahost) + ldap server = ahab.samba.org + + # Define the SSL option when connecting to the directory + # ('off', 'start tls', or 'on' (default)) + ldap ssl = start tls + + # define the port to use in the LDAP session (defaults to 636 when + # "ldap ssl = on") + ldap port = 389 + + # specify the base DN to use when searching the directory + ldap suffix = "ou=people,dc=samba,dc=org" + + # generally the default ldap search filter is ok + # ldap filter = "(&(uid=%u)(objectclass=sambaAccount))"
As users accounts are managed thru the sambaAccount objectclass, you should +modify you existing administration tools to deal with sambaAccount attributes.
Machines accounts are managed with the sambaAccount objectclass, just +like users accounts. However, it's up to you to stored thoses accounts +in a different tree of you LDAP namespace: you should use +"ou=Groups,dc=plainjoe,dc=org" to store groups and +"ou=People,dc=plainjoe,dc=org" to store users. Just configure your +NSS and PAM accordingly (usually, in the /etc/ldap.conf configuration +file).
In Samba release 3.0, the group management system is based on posix +groups. This means that Samba make usage of the posixGroup objectclass. +For now, there is no NT-like group system management (global and local +groups).
There are two important points to remember when discussing the security +of sambaAccount entries in the directory.
Never retrieve the lmPassword or + ntPassword attribute values over an unencrypted LDAP session.
Never allow non-admin users to + view the lmPassword or ntPassword attribute values.
These password hashes are clear text equivalents and can be used to impersonate +the user without deriving the original clear text strings. For more information +on the details of LM/NT password hashes, refer to the ENCRYPTION chapter of the Samba-HOWTO-Collection.
To remedy the first security issue, the "ldap ssl" smb.conf parameter defaults +to require an encrypted session (ldap ssl = on) using +the default port of 636 +when contacting the directory server. When using an OpenLDAP 2.0 server, it +is possible to use the use the StartTLS LDAP extended operation in the place of +LDAPS. In either case, you are strongly discouraged to disable this security +(ldap ssl = off).
Note that the LDAPS protocol is deprecated in favor of the LDAPv3 StartTLS +extended operation. However, the OpenLDAP library still provides support for +the older method of securing communication between clients and servers.
The second security precaution is to prevent non-administrative users from +harvesting password hashes from the directory. This can be done using the +following ACL in slapd.conf:
## allow the "ldap admin dn" access, but deny everyone else +access to attrs=lmPassword,ntPassword + by dn="cn=Samba Admin,ou=people,dc=plainjoe,dc=org" write + by * none
The sambaAccount objectclass is composed of the following attributes:
lmPassword: the LANMAN password 16-byte hash stored as a character + representation of a hexidecimal string.
ntPassword: the NT password hash 16-byte stored as a character + representation of a hexidecimal string.
pwdLastSet: The integer time in seconds since 1970 when the + lmPassword and ntPassword attributes were last set. +
acctFlags: string of 11 characters surrounded by square brackets [] + representing account flags such as U (user), W(workstation), X(no password expiration), and + D(disabled).
logonTime: Integer value currently unused
logoffTime: Integer value currently unused
kickoffTime: Integer value currently unused
pwdCanChange: Integer value currently unused
pwdMustChange: Integer value currently unused
homeDrive: specifies the drive letter to which to map the + UNC path specified by homeDirectory. The drive letter must be specified in the form "X:" + where X is the letter of the drive to map. Refer to the "logon drive" parameter in the + smb.conf(5) man page for more information.
scriptPath: The scriptPath property specifies the path of + the user's logon script, .CMD, .EXE, or .BAT file. The string can be null. The path + is relative to the netlogon share. Refer to the "logon script" parameter in the + smb.conf(5) man page for more information.
profilePath: specifies a path to the user's profile. + This value can be a null string, a local absolute path, or a UNC path. Refer to the + "logon path" parameter in the smb.conf(5) man page for more information.
smbHome: The homeDirectory property specifies the path of + the home directory for the user. The string can be null. If homeDrive is set and specifies + a drive letter, homeDirectory should be a UNC path. The path must be a network + UNC path of the form \\server\share\directory. This value can be a null string. + Refer to the "logon home" parameter in the smb.conf(5) man page for more information. +
userWorkstation: character string value currently unused. +
rid: the integer representation of the user's relative identifier + (RID).
primaryGroupID: the relative identifier (RID) of the primary group + of the user.
The majority of these parameters are only used when Samba is acting as a PDC of +a domain (refer to the Samba-PDC-HOWTO for details on +how to configure Samba as a Primary Domain Controller). The following four attributes +are only stored with the sambaAccount entry if the values are non-default values:
smbHome
scriptPath
logonPath
homeDrive
These attributes are only stored with the sambaAccount entry if +the values are non-default values. For example, assume TASHTEGO has now been +configured as a PDC and that logon home = \\%L\%u was defined in +its smb.conf file. When a user named "becky" logons to the domain, +the logon home string is expanded to \\TASHTEGO\becky. +If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org", +this value is used. However, if this attribute does not exist, then the value +of the logon home parameter is used in its place. Samba +will only write the attribute value to the directory entry is the value is +something other than the default (e.g. \\MOBY\becky).
The following is a working LDIF with the inclusion of the posixAccount objectclass:
Alternative means of name resolution includes: -
dn: uid=guest2, ou=people,dc=plainjoe,dc=org +ntPassword: 878D8014606CDA29677A44EFA1353FC7 +pwdMustChange: 2147483647 +primaryGroupID: 1201 +lmPassword: 552902031BEDE9EFAAD3B435B51404EE +pwdLastSet: 1010179124 +logonTime: 0 +objectClass: sambaAccount +uid: guest2 +kickoffTime: 2147483647 +acctFlags: [UX ] +logoffTime: 2147483647 +rid: 19006 +pwdCanChange: 0
/etc/hosts: is static, hard to maintain, and lacks name_type info |
DNS: is a good choice but lacks essential name_type info. |
Many sites want to restrict DNS lookups and want to avoid broadcast name -resolution traffic. The "name resolve order" parameter is of great help here. -The syntax of the "name resolve order" parameter is: -
name resolve order = wins lmhosts bcast host-_or_ -
name resolve order = wins lmhosts (eliminates bcast and host)-The default is: -
name resolve order = host lmhost wins bcast. -where "host" refers the the native methods used by the Unix system -to implement the gethostbyname() function call. This is normally -controlled by /etc/host.conf, /etc/nsswitch.conf and /etc/resolv.conf.dn: uid=gcarter, ou=people,dc=plainjoe,dc=org +logonTime: 0 +displayName: Gerald Carter +lmPassword: 552902031BEDE9EFAAD3B435B51404EE +primaryGroupID: 1201 +objectClass: posixAccount +objectClass: sambaAccount +acctFlags: [UX ] +userPassword: {crypt}BpM2ej8Rkzogo +uid: gcarter +uidNumber: 9000 +cn: Gerald Carter +loginShell: /bin/bash +logoffTime: 2147483647 +gidNumber: 100 +kickoffTime: 2147483647 +pwdLastSet: 1010179230 +rid: 19000 +homeDirectory: /home/tashtego/gcarter +pwdCanChange: 0 +pwdMustChange: 2147483647 +ntPassword: 878D8014606CDA29677A44EFA1353FC7
Newer windows clients send encrypted passwords over - the wire, instead of plain text passwords. The newest clients - will only send encrypted passwords and refuse to send plain text - passwords, unless their registry is tweaked.
To build the plugin, run make bin/pdb_mysql.so +in the source/ directory of samba distribution.These passwords can't be converted to unix style encrypted - passwords. Because of that you can't use the standard unix - user database, and you have to store the Lanman and NT hashes - somewhere else. For more information, see the documentation - about the Next, copy pdb_mysql.so to any location you want. I +strongly recommend installing it in $PREFIX/lib or /usr/lib/samba/
You either can set up your own table and specify the field names to pdb_mysql (see below +for the column names) or use the default table. The file examples/pdb/mysql/mysql.dump +contains the correct queries to create the required tables. Use the command : + +passdb backend = parameter. -
mysql -uusername -hhostname -ppassword databasename < /path/to/samba/examples/pdb/mysql/mysql.dumpThe unix and SMB password encryption techniques seem similar - on the surface. This similarity is, however, only skin deep. The unix - scheme typically sends clear text passwords over the network when - logging in. This is bad. The SMB encryption scheme never sends the - cleartext password over the network but it does store the 16 byte - hashed values on disk. This is also bad. Why? Because the 16 byte hashed - values are a "password equivalent". You cannot derive the user's - password from them, but they could potentially be used in a modified - client to gain access to a server. This would require considerable - technical knowledge on behalf of the attacker but is perfectly possible. - You should thus treat the smbpasswd file as though it contained the - cleartext passwords of all your users. Its contents must be kept - secret, and the file should be protected accordingly.
This plugin lacks some good documentation, but here is some short info:Ideally we would like a password scheme which neither requires - plain text passwords on the net or on disk. Unfortunately this - is not available as Samba is stuck with being compatible with - other SMB systems (WinNT, WfWg, Win95 etc).
Add a the following to the passdb backend variable in your smb.conf: +passdb backend = [other-plugins] plugin:/location/to/pdb_mysql.so:identifier [other-plugins]
The identifier can be any string you like, as long as it doesn't collide with +the identifiers of other plugins or other instances of pdb_mysql. If you +specify multiple pdb_mysql.so entries in 'passdb backend', you also need to +use different identifiers!
Additional options can be given thru the smb.conf file in the [global] section.
identifier:mysql host - host name, defaults to 'localhost' +identifier:mysql password +identifier:mysql user - defaults to 'samba' +identifier:mysql database - defaults to 'samba' +identifier:mysql port - defaults to 3306 +identifier:table - Name of the table containing users
Note that Windows NT 4.0 Service pack 3 changed the - default for permissible authentication so that plaintext - passwords are never sent over the wire. - The solution to this is either to switch to encrypted passwords - with Samba or edit the Windows NT registry to re-enable plaintext - passwords. See the document WinNT.txt for details on how to do - this.
Other Microsoft operating systems which also exhibit - this behavior includes
MS DOS Network client 3.0 with - the basic network redirector installed
Windows 95 with the network redirector - update installed
Windows 98 [se]
Windows 2000
identifier:logon time column - int(9) +identifier:logoff time column - int(9) +identifier:kickoff time column - int(9) +identifier:pass last set time column - int(9) +identifier:pass can change time column - int(9) +identifier:pass must change time column - int(9) +identifier:username column - varchar(255) - unix username +identifier:domain column - varchar(255) - NT domain user is part of +identifier:nt username column - varchar(255) - NT username +identifier:fullname column - varchar(255) - Full name of user +identifier:home dir column - varchar(255) - Unix homedir path +identifier:dir drive column - varchar(2) - Directory drive path (eg: 'H:') +identifier:logon script column - varchar(255) - Batch file to run on client side when logging on +identifier:profile path column - varchar(255) - Path of profile +identifier:acct desc column - varchar(255) - Some ASCII NT user data +identifier:workstations column - varchar(255) - Workstations user can logon to (or NULL for all) +identifier:unknown string column - varchar(255) - unknown string +identifier:munged dial column - varchar(255) - ? +identifier:uid column - int(9) - Unix user ID (uid) +identifier:gid column - int(9) - Unix user group (gid) +identifier:user sid column - varchar(255) - NT user SID +identifier:group sid column - varchar(255) - NT group ID +identifier:lanman pass column - varchar(255) - encrypted lanman password +identifier:nt pass column - varchar(255) - encrypted nt passwd +identifier:plain pass column - varchar(255) - plaintext password +identifier:acct control column - int(9) - nt user data +identifier:unknown 3 column - int(9) - unknown +identifier:logon divs column - int(9) - ? +identifier:hours len column - int(9) - ? +identifier:unknown 5 column - int(9) - unknown +identifier:unknown 6 column - int(9) - unknown
Note :All current release of - Microsoft SMB/CIFS clients support authentication via the - SMB Challenge/Response mechanism described here. Enabling - clear text authentication does not disable the ability - of the client to participate in encrypted authentication.
Eventually, you can put a colon (:) after the name of each column, which +should specify the column to update when updating the table. You can also +specify nothing behind the colon - then the data from the field will not be +updated.plain text passwords are not passed across - the network. Someone using a network sniffer cannot just - record passwords going to the SMB server.
WinNT doesn't like talking to a server - that isn't using SMB encrypted passwords. It will refuse - to browse the server if the server is also in user level - security mode. It will insist on prompting the user for the - password on each connection, which is very annoying. The - only things you can do to stop this is to use SMB encryption. -
plain text passwords are not kept - on disk.
uses same password file as other unix - services such as login and ftp
you are probably already using other - services (such as telnet and ftp) which send plain text - passwords over the net, so sending them for SMB isn't - such a big deal.
The smbpasswd command maintains the two 32 byte password fields - in the smbpasswd file. If you wish to make it similar to the unix - passwd or yppasswd programs, - install it in /usr/local/samba/bin/ (or your - main Samba binary directory).
3.8. Passdb XML pluginsmbpasswd now works in a client-server mode - where it contacts the local smbd to change the user's password on its - behalf. This has enormous benefits - as follows.
This module requires libxml2 to be installed.To build pdb_xml, run: smbpasswd now has the capability - to change passwords on Windows NT servers (this only works when - the request is sent to the NT Primary Domain Controller if you - are changing an NT Domain user's password).
To run smbpasswd as a normal user just type :
$ smbpasswd
Old SMB password: <type old value here - - or hit return if there was no old password>
New SMB Password: <type new value> -
Repeat New SMB Password: <re-type new value -
If the old value does not match the current value stored for - that user, or the two new values do not match each other, then the - password will not be changed.
If invoked by an ordinary user it will only allow the user - to change his or her own Samba password.
If run by the root user smbpasswd may take an optional - argument, specifying the user name whose SMB password you wish to - change. Note that when run as root smbpasswd does not prompt for - or check the old password value, thus allowing root to set passwords - for users who have forgotten their passwords.
make bin/pdb_xml.so in +the directory source/.smbpasswd is designed to work in the same way - and be familiar to UNIX users who use the passwd or - The usage of pdb_xml is pretty straightforward. To export data, use: + +yppasswd commands.
pdbedit -e plugin:/usr/lib/samba/pdb_xml.so:filename + +(where filename is the name of the file to put the data in)For more details on using To import data, use: +smbpasswd refer - to the man page which will always be the definitive reference.
pdbedit -i plugin:/usr/lib/samba/pdb_xml.so:filename -e current-pdb + +Where filename is the name to read the data from and current-pdb to put it in.This part contains information on using samba in a (NT 4 or ADS) domain. -If you wish to run samba as a domain member or DC, read the appropriate chapter in -this part.
Samba can operate in various SMB networks. This part contains information on configuring samba +for various environments.A SMB server tells the client at startup what "security level" it is +running. There are two options "share level" and "user level". Which +of these two the client receives affects the way the client then tries +to authenticate itself. It does not directly affect (to any great +extent) the way the Samba server does security. I know this is +strange, but it fits in with the client/server approach of SMB. In SMB +everything is initiated and controlled by the client, and the server +can only tell the client what is available and whether an action is +allowed.
I'll describe user level security first, as its simpler. In user level +security the client will send a "session setup" command directly after +the protocol negotiation. This contains a username and password. The +server can either accept or reject that username/password +combination. Note that at this stage the server has no idea what +share the client will eventually try to connect to, so it can't base +the "accept/reject" on anything other than:
the username/password
the machine that the client is coming from
If the server accepts the username/password then the client expects to +be able to mount any share (using a "tree connection") without +specifying a password. It expects that all access rights will be as +the username/password specified in the "session setup".
It is also possible for a client to send multiple "session setup" +requests. When the server responds it gives the client a "uid" to use +as an authentication tag for that username/password. The client can +maintain multiple authentication contexts in this way (WinDD is an +example of an application that does this)
Ok, now for share level security. In share level security the client +authenticates itself separately for each share. It will send a +password along with each "tree connection" (share mount). It does not +explicitly send a username with this operation. The client is +expecting a password to be associated with each share, independent of +the user. This means that samba has to work out what username the +client probably wants to use. It is never explicitly sent the +username. Some commercial SMB servers such as NT actually associate +passwords directly with shares in share level security, but samba +always uses the unix authentication scheme where it is a +username/password that is authenticated, not a "share/password".
Many clients send a "session setup" even if the server is in share +level security. They normally send a valid username but no +password. Samba records this username in a list of "possible +usernames". When the client then does a "tree connection" it also adds +to this list the name of the share they try to connect to (useful for +home directories) and any users listed in the "user =" smb.conf +line. The password is then checked in turn against these "possible +usernames". If a match is found then the client is authenticated as +that user.
Finally "server level" security. In server level security the samba +server reports to the client that it is in user level security. The +client then does a "session setup" as described earlier. The samba +server takes the username/password that the client sends and attempts +to login to the "password server" by sending exactly the same +username/password that it got from the client. If that server is in +user level security and accepts the password then samba accepts the +clients connection. This allows the samba server to use another SMB +server as the "password server".
You should also note that at the very start of all this, where the +server tells the client what security level it is in, it also tells +the client if it supports encryption. If it does then it supplies the +client with a random "cryptkey". The client will then send all +passwords in encrypted form. You have to compile samba with encryption +enabled to support this feature, and you have to maintain a separate +smbpasswd file with SMB style encrypted passwords. It is +cryptographically impossible to translate from unix style encryption +to SMB style encryption, although there are some fairly simple management +schemes by which the two could be kept in sync.
"security = server" means that Samba reports to clients that +it is running in "user mode" but actually passes off all authentication +requests to another "user mode" server. This requires an additional +parameter "password server =" that points to the real authentication server. +That real authentication server can be another Samba server or can be a +Windows NT server, the later natively capable of encrypted password support.
Before you continue reading in this chapter, please make sure that you are comfortable with configuring basic files services @@ -3885,9 +4339,9 @@ CLASS="SECT1" >
The first step in creating a working Samba PDC is to understand the parameters necessary in smb.conf. I will not @@ -4249,9 +4703,9 @@ CLASS="SECT1" >
A machine trust account is a Samba account that is used to @@ -4323,9 +4777,9 @@ CLASS="SECT2" >
The first step in manually creating a machine trust account is to
manually create the corresponding Unix account in
@@ -4477,7 +4931,7 @@ WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
>
The second (and recommended) way of creating machine trust accounts is simply to allow the Samba server to create them as needed when the client @@ -4541,7 +4995,7 @@ be created manually.
[global] - # <...remainder of parameters...> + # <...remainder of parameters...> add user script = /usr/sbin/useradd -d /dev/null -g 100 -s /bin/false -M %u
The procedure for joining a client to the domain varies with the version of Windows.
Much of the information necessary to implement System Policies and Roving User Profiles in a Samba domain is the same as that for @@ -5005,9 +5459,9 @@ CLASS="SECT1" >
There are many sources of information available in the form of mailing lists, RFC's and documentation. The docs that come @@ -5425,9 +5879,9 @@ CLASS="SECT1" >
The client broadcasts (to the IP broadcast address of the subnet it is in) - a NetLogon request. This is sent to the NetBIOS name DOMAIN<1c> at the + a NetLogon request. This is sent to the NetBIOS name DOMAIN<1c> at the NetBIOS layer. The client chooses the first response it receives, which contains the NetBIOS name of the logon server to use in the format of \\SERVER. @@ -5559,9 +6013,9 @@ CLASS="SECT2" >
The main difference between a PDC and a Windows 9x logon server configuration is that
To support WinNT clients, in the [global] section of smb.conf set the following (for example):
To support Win9X clients, you must use the "logon home" parameter. Samba has now been fixed so that "net use/home" now works as well, and it, too, relies @@ -5800,9 +6254,9 @@ CLASS="SECT3" >
You can support profiles for both Win9X and WinNT clients by setting both the "logon home" and "logon path" parameters. For example:
When a user first logs in on Windows 9X, the file user.DAT is created, as are folders "Start Menu", "Desktop", "Programs" and "Nethood". @@ -6005,9 +6459,9 @@ CLASS="SECT3" >
When a user first logs in to a Windows NT Workstation, the profile
NTuser.DAT is created. The profile location can be now specified
@@ -6026,7 +6480,7 @@ WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
>
There is nothing to stop you specifying any path that you like for the location of users' profiles. Therefore, you could specify that the @@ -6133,9 +6587,9 @@ CLASS="SECT3" >
Before you continue reading in this chapter, please make sure that you are comfortable with configuring a Samba PDC @@ -6388,9 +6842,9 @@ CLASS="SECT1" >
What is a Domain Controller? It is a machine that is able to answer logon requests from workstations in a Windows NT Domain. Whenever a @@ -6433,9 +6887,9 @@ CLASS="SECT1" >
Every machine that is a Domain Controller for the domain SAMBA has to register the NetBIOS group name SAMBA#1c with the WINS server and/or @@ -6450,9 +6904,9 @@ CLASS="SECT2" >
A NT workstation in the domain SAMBA that wants a local user to be authenticated has to find the domain controller for SAMBA. It does @@ -6469,9 +6923,9 @@ CLASS="SECT2" >
Whenever a user wants to change his password, this has to be done on the PDC. To find the PDC, the workstation does a NetBIOS name query @@ -6485,15 +6939,19 @@ CLASS="SECT1" >
With version 2.2, no. The native NT SAM replication protocols have not yet been fully implemented. The Samba Team is working on understanding and implementing the protocols, but this work has not been finished for version 2.2.
With version 3.0, the work on both the replication protocols and a +suitable storage mechanism has progressed, and some form of NT4 BDC +support is expected soon.
Can I get the benefits of a BDC with Samba? Yes. The main reason for implementing a BDC is availability. If the PDC is a Samba machine, a second Samba machine can be set up to @@ -6504,9 +6962,9 @@ CLASS="SECT1" >
Several things have to be done:
Replication of the smbpasswd file is sensitive. It has to be done whenever changes to the SAM are made. Every user's password change is @@ -6587,6 +7045,21 @@ rsync. rsync can use ssh as a transport. ssh itself can be set up to accept *only* rsync transfer without requiring the user to type a password.
The simple answer is YES. Samba's pdb_ldap code supports +binding to a replica LDAP server, and will also follow referrals and +rebind to the master if it ever needs to make a modification to the +database. (Normally BDCs are read only, so this will not occur +often).
This is a rough guide to setting up Samba 3.0 with kerberos authentication against a +Windows2000 KDC.
Pieces you need before you begin:
This is a VERY ROUGH guide to setting up the current (November 2001) -pre-alpha version of Samba 3.0 with kerberos authentication against a -Windows2000 KDC. The procedures listed here are likely to change as -the code develops.
Pieces you need before you begin: -
14.2.1. Creating [print$]13.2.1. Creating [print$]In order to support the uploading of printer driver
files, you must first configure a file share named [print$].
@@ -10590,7 +10990,7 @@ WIDTH="25"
ALIGN="CENTER"
VALIGN="TOP"
> | 14.2.2. Setting Drivers for Existing Printers13.2.2. Setting Drivers for Existing PrintersThe initial listing of printers in the Samba host's Printers folder will have no real printer driver assigned @@ -10804,9 +11204,9 @@ CLASS="SECT2" > 14.2.3. Support a large number of printers13.2.3. Support a large number of printersOne issue that has arisen during the development phase of Samba 2.2 is the need to support driver downloads for @@ -10870,9 +11270,9 @@ CLASS="SECT2" > 14.2.4. Adding New Printers via the Windows NT APW13.2.4. Adding New Printers via the Windows NT APWBy default, Samba offers all printer shares defined in Windows NT/2000 print servers associate a port with each printer. These normally take the form of LPT1:, COM1:, FILE:, etc... Samba must also support the @@ -11076,9 +11476,9 @@ CLASS="SECT1" > 14.3. The Imprints Toolset13.3. The Imprints ToolsetThe Imprints tool set provides a UNIX equivalent of the Windows NT Add Printer Wizard. For complete information, please @@ -11094,9 +11494,9 @@ CLASS="SECT2" > 14.3.1. What is Imprints?13.3.1. What is Imprints?Imprints is a collection of tools for supporting the goals of 14.3.2. Creating Printer Driver Packages13.3.2. Creating Printer Driver PackagesThe process of creating printer driver packages is beyond the scope of this document (refer to Imprints.txt also included @@ -11142,9 +11542,9 @@ CLASS="SECT2" > 14.3.3. The Imprints server13.3.3. The Imprints serverThe Imprints server is really a database server that may be queried via standard HTTP mechanisms. Each printer @@ -11166,9 +11566,9 @@ CLASS="SECT2" > 14.3.4. The Installation Client13.3.4. The Installation ClientMore information regarding the Imprints installation client
is available in the This is a short description of how to debug printing problems with
Samba. This describes how to debug problems with printing from a SMB
@@ -11343,9 +11743,9 @@ CLASS="SECT2"
> One way to debug printing problems is to start by replacing these
command with shell scripts that record the arguments and the contents
@@ -11361,7 +11761,7 @@ CLASS="PROGRAMLISTING"
/usr/bin/id -p >/tmp/tmp.print
# we run the command and save the error messages
# replace the command with the one appropriate for your system
- /usr/bin/lpr -r -P$1 $2 2>>&/tmp/tmp.print Then you print a file and try removing it. You may find that the
@@ -11400,9 +11800,9 @@ CLASS="SECT2"
> You can use the 'testprns' program to check to see if the printer
name you are using is recognized by Samba. For example, you can
@@ -11429,9 +11829,9 @@ CLASS="SECT2"
> You may need to set up some printcaps for your Samba system to use.
It is strongly recommended that you use the facilities provided by
@@ -11513,9 +11913,9 @@ CLASS="SECT2"
> This is the most frustrating part of printing. You may have sent the
job, verified that the job was forwarded, set up a wrapper around
@@ -11558,9 +11958,9 @@ CLASS="SECT2"
> Once you have the job printing, you can then start worrying about
making it print nicely. This is a problem that is usually caused by either the print spooling
system putting information at the start of the print job that makes
@@ -11619,9 +12019,9 @@ CLASS="SECT2"
> Note that you can do some pretty magic things by using your
imagination with the "print command" option and some shell scripts.
@@ -11635,9 +12035,9 @@ CLASS="SECT2"
> If the above debug tips don't help, then maybe you need to bring in
the bug guns, system tracing. See Tracing.txt in this directory. Samba supports the following options to the global smb.conf parameter Please refer to the smb.conf man page for usage information and to the document
-DOMAIN_MEMBER.html for further background details
-on domain mode security. The Windows 2000 Kerberos domain security model
-(security = ads) is described in the ADS-HOWTO.html. Of the above, "security = server" means that Samba reports to clients that
-it is running in "user mode" but actually passes off all authentication
-requests to another "user mode" server. This requires an additional
-parameter "password server =" that points to the real authentication server.
-That real authentication server can be another Samba server or can be a
-Windows NT server, the later natively capable of encrypted password support. A SMB server tells the client at startup what "security level" it is
-running. There are two options "share level" and "user level". Which
-of these two the client receives affects the way the client then tries
-to authenticate itself. It does not directly affect (to any great
-extent) the way the Samba server does security. I know this is
-strange, but it fits in with the client/server approach of SMB. In SMB
-everything is initiated and controlled by the client, and the server
-can only tell the client what is available and whether an action is
-allowed. I'll describe user level security first, as its simpler. In user level
-security the client will send a "session setup" command directly after
-the protocol negotiation. This contains a username and password. The
-server can either accept or reject that username/password
-combination. Note that at this stage the server has no idea what
-share the client will eventually try to connect to, so it can't base
-the "accept/reject" on anything other than: the username/password the machine that the client is coming from If the server accepts the username/password then the client expects to
-be able to mount any share (using a "tree connection") without
-specifying a password. It expects that all access rights will be as
-the username/password specified in the "session setup". It is also possible for a client to send multiple "session setup"
-requests. When the server responds it gives the client a "uid" to use
-as an authentication tag for that username/password. The client can
-maintain multiple authentication contexts in this way (WinDD is an
-example of an application that does this) Ok, now for share level security. In share level security the client
-authenticates itself separately for each share. It will send a
-password along with each "tree connection" (share mount). It does not
-explicitly send a username with this operation. The client is
-expecting a password to be associated with each share, independent of
-the user. This means that samba has to work out what username the
-client probably wants to use. It is never explicitly sent the
-username. Some commercial SMB servers such as NT actually associate
-passwords directly with shares in share level security, but samba
-always uses the unix authentication scheme where it is a
-username/password that is authenticated, not a "share/password". Many clients send a "session setup" even if the server is in share
-level security. They normally send a valid username but no
-password. Samba records this username in a list of "possible
-usernames". When the client then does a "tree connection" it also adds
-to this list the name of the share they try to connect to (useful for
-home directories) and any users listed in the "user =" smb.conf
-line. The password is then checked in turn against these "possible
-usernames". If a match is found then the client is authenticated as
-that user. Finally "server level" security. In server level security the samba
-server reports to the client that it is in user level security. The
-client then does a "session setup" as described earlier. The samba
-server takes the username/password that the client sends and attempts
-to login to the "password server" by sending exactly the same
-username/password that it got from the client. If that server is in
-user level security and accepts the password then samba accepts the
-clients connection. This allows the samba server to use another SMB
-server as the "password server". You should also note that at the very start of all this, where the
-server tells the client what security level it is in, it also tells
-the client if it supports encryption. If it does then it supplies the
-client with a random "cryptkey". The client will then send all
-passwords in encrypted form. You have to compile samba with encryption
-enabled to support this feature, and you have to maintain a separate
-smbpasswd file with SMB style encrypted passwords. It is
-cryptographically impossible to translate from unix style encryption
-to SMB style encryption, although there are some fairly simple management
-schemes by which the two could be kept in sync. Integration of UNIX and Microsoft Windows NT through
a unified logon has been considered a "holy grail" in heterogeneous
@@ -11831,9 +12083,9 @@ CLASS="SECT1"
> It is well known that UNIX and Microsoft Windows NT have
different models for representing user and group information and
@@ -11885,9 +12137,9 @@ CLASS="SECT1"
> Winbind unifies UNIX and Windows NT account management by
allowing a UNIX box to become a full member of a NT domain. Once
@@ -11927,9 +12179,9 @@ CLASS="SECT2"
> Winbind is targeted at organizations that have an
existing NT based domain infrastructure into which they wish
@@ -11951,9 +12203,9 @@ CLASS="SECT1"
> The winbind system is designed around a client/server
architecture. A long running Over the last two years, efforts have been underway
+>Over the last few years, efforts have been underway
by various Samba Team members to decode various aspects of
the Microsoft Remote Procedure Call (MSRPC) system. This
system is used for most network related operations between
@@ -11997,9 +12249,28 @@ CLASS="SECT2"
> Since late 2001, Samba has gained the ability to
+ interact with Microsoft Windows 2000 using its 'Native
+ Mode' protocols, rather than the NT4 RPC services.
+ Using LDAP and Kerberos, a domain member running
+ winbind can enumerate users and groups in exactly the
+ same way as a Win2k client would, and in so doing
+ provide a much more efficient and
+ effective winbind implementation.
+ The Name Service Switch, or NSS, is a feature that is
present in many UNIX operating systems. It allows system
@@ -12077,9 +12348,9 @@ CLASS="SECT2"
> Pluggable Authentication Modules, also known as PAM,
is a system for abstracting authentication and authorization
@@ -12126,9 +12397,9 @@ CLASS="SECT2"
> When a user or group is created under Windows NT
is it allocated a numerical relative identifier (RID). This is
@@ -12152,9 +12423,9 @@ CLASS="SECT2"
> An active system can generate a lot of user and group
name lookups. To reduce the network cost of these lookups winbind
@@ -12175,9 +12446,9 @@ CLASS="SECT1"
> Many thanks to John Trostel This HOWTO describes the procedures used to get winbind up and
running on my RedHat 7.1 system. Winbind is capable of providing access
@@ -12261,9 +12532,9 @@ CLASS="SECT2"
> If you have a samba configuration file that you are currently
using... Before starting, it is probably best to kill off all the SAMBA
related daemons running on your server. Kill off all The configuration and compilation of SAMBA is pretty straightforward.
The first three steps may not be necessary depending upon
@@ -12412,7 +12683,7 @@ CLASS="PROMPT"
>root# ./configure --with-winbind./configure
Several parameters are needed in the smb.conf file to control
the behavior of Enter the following command to make the SAMBA server join the
PDC domain, where root# /usr/local/samba/bin/net rpc join -S PDC -U Administrator/usr/local/samba/bin/net join -S PDC -U Administrator The proper response to the command should be: "Joined the domain
@@ -12668,9 +12939,9 @@ CLASS="SECT3"
> Eventually, you will want to modify your smb startup script to
automatically invoke the winbindd daemon when the other parts of
@@ -12791,17 +13062,17 @@ CLASS="SECT3"
> The On solaris, you need to modify the
If you restart the If you have made it this far, you know that winbindd and samba are working
together. If you want to use winbind to provide authentication for other
@@ -13048,9 +13319,9 @@ CLASS="SECT4"
> The The /etc/pam.conf needs to be changed. I changed this file so that my Domain
users can logon both locally as well as telnet.The following are the changes
@@ -13253,7 +13524,7 @@ dtsession auth required /usr/lib/security/$ISA/pam_unix.so.1
>I also added a try_first_pass line after the winbind.so line to get rid of
annoying double prompts for passwords. Now restart your Samba & try connecting through your application that you
+>Now restart your Samba and try connecting through your application that you
configured in the pam.conf. Winbind has a number of limitations in its current
released version that we hope to overcome in future
@@ -13277,7 +13548,7 @@ NAME="AEN2566"
> Winbind is currently only available for
- the Linux operating system, although ports to other operating
+ the Linux, Solaris and IRIX operating systems, although ports to other operating
systems are certainly possible. For such ports to be feasible,
we require the C library of the target operating system to
support the Name Service Switch and Pluggable Authentication
@@ -13286,1116 +13557,1027 @@ NAME="AEN2566"
> The mappings of Windows NT RIDs to UNIX ids
- is not made algorithmically and depends on the order in which
- unmapped users or groups are seen by winbind. It may be difficult
- to recover the mappings of rid to UNIX id mapping if the file
- containing this information is corrupted or destroyed. Currently the winbind PAM module does not take
+ into account possible workstation and logon time restrictions
+ that may be been set for Windows NT users, this is
+ instead up to the PDC to enforce. The winbind system, through the use of the Name Service
+ Switch, Pluggable Authentication Modules, and appropriate
+ Microsoft RPC calls have allowed us to provide seamless
+ integration of Microsoft Windows NT domain users on a
+ UNIX system. The result is a great reduction in the administrative
+ cost of running a mixed UNIX and NT network. SMB networking provides a mechanism by which clients can access a list
+of machines in a network, a so-called "browse list". This list
+contains machines that are ready to offer file and/or print services
+to other machines within the network. Thus it does not include
+machines which aren't currently able to do server tasks. The browse
+list is heavily used by all SMB clients. Configuration of SMB
+browsing has been problematic for some Samba users, hence this
+document. Browsing will NOT work if name resolution from NetBIOS names to IP
+addresses does not function correctly. Use of a WINS server is highly
+recommended to aid the resolution of NetBIOS (SMB) names to IP addresses.
+WINS allows remote segment clients to obtain NetBIOS name_type information
+that can NOT be provided by any other means of name resolution. Samba now fully supports browsing. The browsing is supported by nmbd
+and is also controlled by options in the smb.conf file (see smb.conf(5)). Samba can act as a local browse master for a workgroup and the ability
+for samba to support domain logons and scripts is now available. See
+DOMAIN.txt for more information on domain logons. Samba can also act as a domain master browser for a workgroup. This
+means that it will collate lists from local browse masters into a
+wide area network server list. In order for browse clients to
+resolve the names they may find in this list, it is recommended that
+both samba and your clients use a WINS server. Note that you should NOT set Samba to be the domain master for a
+workgroup that has the same name as an NT Domain: on each wide area
+network, you must only ever have one domain master browser per workgroup,
+regardless of whether it is NT, Samba or any other type of domain master
+that is providing this service. [Note that nmbd can be configured as a WINS server, but it is not
+necessary to specifically use samba as your WINS server. NTAS can
+be configured as your WINS server. In a mixed NT server and
+samba environment on a Wide Area Network, it is recommended that
+you use the NT server's WINS server capabilities. In a samba-only
+environment, it is recommended that you use one and only one nmbd
+as your WINS server]. To get browsing to work you need to run nmbd as usual, but will need
+to use the "workgroup" option in smb.conf to control what workgroup
+Samba becomes a part of. Currently the winbind PAM module does not take
- into account possible workstation and logon time restrictions
- that may be been set for Windows NT users. The winbind system, through the use of the Name Service
- Switch, Pluggable Authentication Modules, and appropriate
- Microsoft RPC calls have allowed us to provide seamless
- integration of Microsoft Windows NT domain users on a
- UNIX system. The result is a great reduction in the administrative
- cost of running a mixed UNIX and NT network. Note that if it doesn't work for you, then you should still be able to
+type the server name as \\SERVER in filemanager then hit enter and
+filemanager should display the list of available shares. Some people find browsing fails because they don't have the global
+"guest account" set to a valid account. Remember that the IPC$
+connection that lists the shares is done as guest, and thus you must
+have a valid guest account. Also, a lot of people are getting bitten by the problem of too many
+parameters on the command line of nmbd in inetd.conf. This trick is to
+not use spaces between the option and the parameter (eg: -d2 instead
+of -d 2), and to not use the -B and -N options. New versions of nmbd
+are now far more likely to correctly find your broadcast and network
+address, so in most cases these aren't needed. The other big problem people have is that their broadcast address,
+netmask or IP address is wrong (specified with the "interfaces" option
+in smb.conf) To build the plugin, run make bin/pdb_mysql.so
-in the source/ directory of samba distribution. Next, copy pdb_mysql.so to any location you want. I
-strongly recommend installing it in $PREFIX/lib or /usr/lib/samba/ Remember, for browsing across subnets to work correctly, all machines,
+be they Windows 95, Windows NT, or Samba servers must have the IP address
+of a WINS server given to them by a DHCP server, or by manual configuration
+(for Win95 and WinNT, this is in the TCP/IP Properties, under Network
+settings) for Samba this is in the smb.conf file. This plugin lacks some good documentation, but here is some short info: Add a the following to the passdb backend variable in your smb.conf:
- The identifier can be any string you like, as long as it doesn't collide with
-the identifiers of other plugins or other instances of pdb_mysql. If you
-specify multiple pdb_mysql.so entries in 'passdb backend', you also need to
-use different identifiers! As all these machines are booted up, elections for master browsers
+will take place on each of the three subnets. Assume that machine
+N1_C wins on subnet 1, N2_B wins on subnet 2, and N3_D wins on
+subnet 3 - these machines are known as local master browsers for
+their particular subnet. N1_C has an advantage in winning as the
+local master browser on subnet 1 as it is set up as Domain Master
+Browser. On each of the three networks, machines that are configured to
+offer sharing services will broadcast that they are offering
+these services. The local master browser on each subnet will
+receive these broadcasts and keep a record of the fact that
+the machine is offering a service. This list of records is
+the basis of the browse list. For this case, assume that
+all the machines are configured to offer services so all machines
+will be on the browse list. For each network, the local master browser on that network is
+considered 'authoritative' for all the names it receives via
+local broadcast. This is because a machine seen by the local
+master browser via a local broadcast must be on the same
+network as the local master browser and thus is a 'trusted'
+and 'verifiable' resource. Machines on other networks that
+the local master browsers learn about when collating their
+browse lists have not been directly seen - these records are
+called 'non-authoritative'. At this point the browse lists look as follows (these are
+the machines you would see in your network neighborhood if
+you looked in it on a particular network right now). Note that at this point all the subnets are separate, no
+machine is seen across any of the subnets. Now examine subnet 2. As soon as N2_B has become the local
+master browser it looks for a Domain master browser to synchronize
+its browse list with. It does this by querying the WINS server
+(N2_D) for the IP address associated with the NetBIOS name
+WORKGROUP>1B<. This name was registerd by the Domain master
+browser (N1_C) with the WINS server as soon as it was booted. Once N2_B knows the address of the Domain master browser it
+tells it that is the local master browser for subnet 2 by
+sending a MasterAnnouncement packet as a UDP port 138 packet.
+It then synchronizes with it by doing a NetServerEnum2 call. This
+tells the Domain Master Browser to send it all the server
+names it knows about. Once the domain master browser receives
+the MasterAnnouncement packet it schedules a synchronization
+request to the sender of that packet. After both synchronizations
+are done the browse lists look like : At this point users looking in their network neighborhood on
+subnets 1 or 2 will see all the servers on both, users on
+subnet 3 will still only see the servers on their own subnet. The same sequence of events that occured for N2_B now occurs
+for the local master browser on subnet 3 (N3_D). When it
+synchronizes browse lists with the domain master browser (N1_A)
+it gets both the server entries on subnet 1, and those on
+subnet 2. After N3_D has synchronized with N1_C and vica-versa
+the browse lists look like. At this point users looking in their network neighborhood on
+subnets 1 or 3 will see all the servers on all sunbets, users on
+subnet 2 will still only see the servers on subnets 1 and 2, but not 3. Additional options can be given thru the smb.conf file in the [global] section. Names of the columns in this table(I've added column types those columns should have first): Eventually, you can put a colon (:) after the name of each column, which
-should specify the column to update when updating the table. You can also
-specify nothing behind the colon - then the data from the field will not be
-updated. I strongly discourage the use of plaintext passwords, however, you can use them: If you would like to use plaintext passwords, set 'identifier:lanman pass column' and 'identifier:nt pass column' to 'NULL' (without the quotes) and 'identifier:plaintext pass column' to the name of the column containing the plaintext passwords. If you use encrypted passwords, set the 'identifier:plaintext pass column' to 'NULL' (without the quotes). This is the default. It is possible to have not all data in the database and making some 'constant'. For example, you can set 'identifier:fullname column' to :
-CONCAT(First_name,' ',Sur_name) Or, set 'identifier:workstations column' to :
-NULL wins support = yes See the MySQL documentation for more language constructs. This module requires libxml2 to be installed. To build pdb_xml, run: make bin/pdb_xml.so in
-the directory source/. The usage of pdb_xml is pretty straightforward. To export data, use:
-
-Machines with "pdbedit -e plugin:/usr/lib/samba/pdb_xml.so:filename
-
-(where filename is the name of the file to put the data in) To import data, use:
-You should set up only ONE wins server. Do NOT set the
+"pdbedit -i plugin:/usr/lib/samba/pdb_xml.so:filename -e current-pdb
-
-Where filename is the name to read the data from and current-pdb to put it in. This document describes how to use an LDAP directory for storing Samba user
-account information traditionally stored in the smbpasswd(5) file. It is
-assumed that the reader already has a basic understanding of LDAP concepts
-and has a working directory server already installed. For more information
-on LDAP architectures and Directories, please refer to the following sites. OpenLDAP - http://www.openldap.org/ iPlanet Directory Server - http://iplanet.netscape.com/directorywins server = >name or IP address< Note that O'Reilly Publishing is working on
-a guide to LDAP for System Administrators which has a planned release date of
-early summer, 2002. Two additional Samba resources which may prove to be helpful are The Samba-PDC-LDAP-HOWTO
- maintained by Ignacio Coupeau. The NT migration scripts from IDEALX that are
- geared to manage users and group in such a Samba-LDAP Domain Controller configuration.
- Traditionally, when configuring "encrypt
-passwords = yes" in Samba's smb.conf file, user account
-information such as username, LM/NT password hashes, password change times, and account
-flags have been stored in the smbpasswd(5) file. There are several
-disadvantages to this approach for sites with very large numbers of users (counted
-in the thousands). The first is that all lookups must be performed sequentially. Given that
-there are approximately two lookups per domain logon (one for a normal
-session connection such as when mapping a network drive or printer), this
-is a performance bottleneck for lareg sites. What is needed is an indexed approach
-such as is used in databases. The second problem is that administrators who desired to replicate a
-smbpasswd file to more than one Samba server were left to use external
-tools such as rsync(1) and ssh(1)
-and wrote custom, in-house scripts. And finally, the amount of information which is stored in an
-smbpasswd entry leaves no room for additional attributes such as
-a home directory, password expiration time, or even a Relative
-Identified (RID). As a result of these defeciencies, a more robust means of storing user attributes
-used by smbd was developed. The API which defines access to user accounts
-is commonly referred to as the samdb interface (previously this was called the passdb
-API, and is still so named in the CVS trees). In Samba 2.2.3, enabling support
-for a samdb backend (e.g. --with-ldapsam or
---with-tdbsam) requires compile time support. When compiling Samba to include the --with-ldapsam autoconf
-option, smbd (and associated tools) will store and lookup user accounts in
-an LDAP directory. In reality, this is very easy to understand. If you are
-comfortable with using an smbpasswd file, simply replace "smbpasswd" with
-"LDAP directory" in all the documentation. There are a few points to stress about what the --with-ldapsam
-does not provide. The LDAP support referred to in the this documentation does not
-include: A means of retrieving user account information from
- an Windows 2000 Active Directory server. A means of replacing /etc/passwd. The second item can be accomplished by using LDAP NSS and PAM modules. LGPL
-versions of these libraries can be obtained from PADL Software
-(http://www.padl.com/). However,
-the details of configuring these packages are beyond the scope of this document. The LDAP samdb code in 2.2.3 has been developed and tested using the OpenLDAP
-2.0 server and client libraries. The same code should be able to work with
-Netscape's Directory Server and client SDK. However, due to lack of testing
-so far, there are bound to be compile errors and bugs. These should not be
-hard to fix. If you are so inclined, please be sure to forward all patches to
-samba-patches@samba.org and
-jerry@samba.org. Samba 2.2.3 includes the necessary schema file for OpenLDAP 2.0 in
-examples/LDAP/samba.schema. (Note that this schema
-file has been modified since the experimental support initially included
-in 2.2.2). The sambaAccount objectclass is given here: For subnets other than the one containing the Windows NT PDC
+you may set up Samba servers as local master browsers as
+described. To make a Samba server a local master browser set
+the following options in the [global] section of the smb.conf
+file : The samba.schema file has been formatted for OpenLDAP 2.0. The OID's are
-owned by the Samba Team and as such is legal to be openly published.
-If you translate the schema to be used with Netscape DS, please
-submit the modified schema file as a patch to jerry@samba.org Just as the smbpasswd file is mean to store information which supplements a
-user's /etc/passwd entry, so is the sambaAccount object
-meant to supplement the UNIX user account information. A sambaAccount is a
-STRUCTURAL objectclass so it can be stored individually
-in the directory. However, there are several fields (e.g. uid) which overlap
-with the posixAccount objectclass outlined in RFC2307. This is by design. In order to store all user account information (UNIX and Samba) in the directory,
-it is necessary to use the sambaAccount and posixAccount objectclasses in
-combination. However, smbd will still obtain the user's UNIX account
-information via the standard C library calls (e.g. getpwnam(), et. al.).
-This means that the Samba server must also have the LDAP NSS library installed
-and functioning correctly. This division of information makes it possible to
-store all Samba account information in LDAP, but still maintain UNIX account
-information in NIS while the network is transitioning to a full LDAP infrastructure. To include support for the sambaAccount object in an OpenLDAP directory
-server, first copy the samba.schema file to slapd's configuration directory. root# cp samba.schema /etc/openldap/schema/ Next, include the samba.schema file in slapd.conf.
-The sambaAccount object contains two attributes which depend upon other schema
-files. The 'uid' attribute is defined in cosine.schema and
-the 'displayName' attribute is defined in the inetorgperson.schema
-file. Both of these must be included before the samba.schema file. It is recommended that you maintain some indices on some of the most usefull attributes,
-like in the following example, to speed up searches made on sambaAccount objectclasses
-(and possibly posixAccount and posixGroup as well). It is possible to configure two samba servers to attempt to become
+the domain master browser for a domain. The first server that comes
+up will be the domain master browser. All other samba servers will
+attempt to become the domain master browser every 5 minutes. They
+will find that another samba server is already the domain master
+browser and will fail. This provides automatic redundancy, should
+the current domain master browser fail. The following parameters are available in smb.conf only with --with-ldapsam
-was included with compiling Samba. These are described in the smb.conf(5) man
-page and so will not be repeated here. However, a sample smb.conf file for
-use with an LDAP directory could appear as your local master browsers will contact the WINS server and, as long as
+ samba has registered that it is a domain master browser with the WINS
+ server, your local master browser will receive samba's ip address
+ as its domain master browser.
+ when a client receives a domain-wide browse list, and a user attempts
+ to access a host in that list, it will contact the WINS server to
+ resolve the NetBIOS name of that host. as long as that host has
+ registered its NetBIOS name with the same WINS server, the user will
+ be able to see that host.
+ As users accounts are managed thru the sambaAccount objectclass, you should
-modify you existing administration tools to deal with sambaAccount attributes. Machines accounts are managed with the sambaAccount objectclass, just
-like users accounts. However, it's up to you to stored thoses accounts
-in a different tree of you LDAP namespace: you should use
-"ou=Groups,dc=plainjoe,dc=org" to store groups and
-"ou=People,dc=plainjoe,dc=org" to store users. Just configure your
-NSS and PAM accordingly (usually, in the /etc/ldap.conf configuration
-file). In Samba release 2.2.3, the group management system is based on posix
-groups. This meand that Samba make usage of the posixGroup objectclass.
-For now, there is no NT-like group system management (global and local
-groups). There are two important points to remember when discussing the security
-of sambaAccount entries in the directory. Never retrieve the lmPassword or
- ntPassword attribute values over an unencrypted LDAP session. Never allow non-admin users to
- view the lmPassword or ntPassword attribute values. These password hashes are clear text equivalents and can be used to impersonate
-the user without deriving the original clear text strings. For more information
-on the details of LM/NT password hashes, refer to the ENCRYPTION chapter of the Samba-HOWTO-Collection. To remedy the first security issue, the "ldap ssl" smb.conf parameter defaults
-to require an encrypted session (ldap ssl = on) using
-the default port of 636
-when contacting the directory server. When using an OpenLDAP 2.0 server, it
-is possible to use the use the StartTLS LDAP extended operation in the place of
-LDAPS. In either case, you are strongly discouraged to disable this security
-(To use the VFS modules, create a share similar to the one below. The
+important parameter is the ldap ssl = off). Note that the LDAPS protocol is deprecated in favor of the LDAPv3 StartTLS
-extended operation. However, the OpenLDAP library still provides support for
-the older method of securing communication between clients and servers. The second security precaution is to prevent non-administrative users from
-harvesting password hashes from the directory. This can be done using the
-following ACL in slapd.conf: The modules are used in the order they are specified. Further documentation on writing VFS modules for Samba can be found in
+the Samba Developers Guide. The sambaAccount objectclass is composed of the following attributes: A simple module to audit file access to the syslog
+facility. The following operations are logged:
+ lmPassword: the LANMAN password 16-byte hash stored as a character
- representation of a hexidecimal string. ntPassword: the NT password hash 16-byte stored as a character
- representation of a hexidecimal string. pwdLastSet: The integer time in seconds since 1970 when the
- lmPassword and ntPassword attributes were last set.
- acctFlags: string of 11 characters surrounded by square brackets []
- representing account flags such as U (user), W(workstation), X(no password expiration), and
- D(disabled). logonTime: Integer value currently unused logoffTime: Integer value currently unused kickoffTime: Integer value currently unused pwdCanChange: Integer value currently unused pwdMustChange: Integer value currently unused homeDrive: specifies the drive letter to which to map the
- UNC path specified by homeDirectory. The drive letter must be specified in the form "X:"
- where X is the letter of the drive to map. Refer to the "logon drive" parameter in the
- smb.conf(5) man page for more information. scriptPath: The scriptPath property specifies the path of
- the user's logon script, .CMD, .EXE, or .BAT file. The string can be null. The path
- is relative to the netlogon share. Refer to the "logon script" parameter in the
- smb.conf(5) man page for more information. profilePath: specifies a path to the user's profile.
- This value can be a null string, a local absolute path, or a UNC path. Refer to the
- "logon path" parameter in the smb.conf(5) man page for more information. smbHome: The homeDirectory property specifies the path of
- the home directory for the user. The string can be null. If homeDrive is set and specifies
- a drive letter, homeDirectory should be a UNC path. The path must be a network
- UNC path of the form \\server\share\directory. This value can be a null string.
- Refer to the "logon home" parameter in the smb.conf(5) man page for more information.
- userWorkstation: character string value currently unused.
- rid: the integer representation of the user's relative identifier
- (RID). primaryGroupID: the relative identifier (RID) of the primary group
- of the user. The majority of these parameters are only used when Samba is acting as a PDC of
-a domain (refer to the Samba-PDC-HOWTO for details on
-how to configure Samba as a Primary Domain Controller). The following four attributes
-are only stored with the sambaAccount entry if the values are non-default values: smbHome scriptPath logonPath homeDrive These attributes are only stored with the sambaAccount entry if
-the values are non-default values. For example, assume TASHTEGO has now been
-configured as a PDC and that logon home = \\%L\%u was defined in
-its smb.conf file. When a user named "becky" logons to the domain,
-the logon home string is expanded to \\TASHTEGO\becky.
-If the smbHome attribute exists in the entry "uid=becky,ou=people,dc=samba,dc=org",
-this value is used. However, if this attribute does not exist, then the value
-of the logon home parameter is used in its place. Samba
-will only write the attribute value to the directory entry is the value is
-something other than the default (e.g. \\MOBY\becky). The following is a working LDIF with the inclusion of the posixAccount objectclass: URL: http://www.css.tayloru.edu/~elorimer/databasefs/index.php The following is an LDIF entry for using both the sambaAccount and
-posixAccount objectclasses: Any feedback would be appreciated: comments, suggestions, patches,
+etc... If nothing else, hopefully it might prove useful for someone
+else who wishes to create a virtual filesystem. Please mail all comments regarding this HOWTO to URL: jerry@samba.org. This documents was
-last updated to reflect the Samba 2.2.3 release.
samba-vscan is a proof-of-concept module for Samba, which
+uses the VFS (virtual file system) features of Samba 2.2.x/3.0
+alphaX. Of couse, Samba has to be compiled with VFS support.
+samba-vscan supports various virus scanners and is maintained
+by Rainer Link. Samba is developed in an open environment. Developers use CVS
(Concurrent Versioning System) to "checkin" (also known as
@@ -14432,9 +14614,9 @@ CLASS="SECT1"
> The machine samba.org runs a publicly accessible CVS
repository for access to the source code of several packages,
@@ -14445,9 +14627,9 @@ CLASS="SECT2"
> You can access the source code via your
favourite WWW browser. This allows you to access the contents of
@@ -14466,9 +14648,9 @@ CLASS="SECT2"
> You can also access the source code via a
normal cvs client. This gives you much more control over you can
@@ -14576,7 +14758,7 @@ CLASS="CHAPTER"
>Chapter 21. Group mapping HOWTOChapter 18. Group mapping HOWTO
Starting with Samba 3.0 alpha 2, a new group mapping function is available. The
@@ -14677,135 +14859,46 @@ CLASS="CHAPTER"
>Chapter 22. Samba performance issuesChapter 19. Samba performance issues The Samba server uses TCP to talk to the client. Thus if you are
trying to see if it performs well you should really compare it to
programs that use the same protocol. The most readily available
programs for file transfer that use TCP are ftp or another TCP based
-SMB server. If you want to test against something like a NT or WfWg server then
-you will have to disable all but TCP on either the client or
-server. Otherwise you may well be using a totally different protocol
-(such as Netbeui) and comparisons may not be valid. Generally you should find that Samba performs similarly to ftp at raw
-transfer speed. It should perform quite a bit faster than NFS,
-although this very much depends on your system. Several people have done comparisons between Samba and Novell, NFS or
-WinNT. In some cases Samba performed the best, in others the worst. I
-suspect the biggest factor is not Samba vs some other system but the
-hardware and drivers used on the various systems. Given similar
-hardware Samba should certainly be competitive in speed with other
-systems. Oplocks are the way that SMB clients get permission from a server to
-locally cache file operations. If a server grants an oplock
-(opportunistic lock) then the client is free to assume that it is the
-only one accessing the file and it will agressively cache file
-data. With some oplock types the client may even cache file open/close
-operations. This can give enormous performance benefits. With the release of Samba 1.9.18 we now correctly support opportunistic
-locks. This is turned on by default, and can be turned off on a share-
-by-share basis by setting the parameter : oplocks = False We recommend that you leave oplocks on however, as current benchmark
-tests with NetBench seem to give approximately a 30% improvement in
-speed with them on. This is on average however, and the actual
-improvement seen can be orders of magnitude greater, depending on
-what the client redirector is doing. Previous to Samba 1.9.18 there was a 'fake oplocks' option. This
-option has been left in the code for backwards compatibility reasons
-but it's use is now deprecated. A short summary of what the old
-code did follows. With Samba 2.0.5 a new capability - level2 (read only) oplocks is
-supported (although the option is off by default - see the smb.conf
-man page for details). Turning on level2 oplocks (on a share-by-share basis)
-by setting the parameter : level2 oplocks = true should speed concurrent access to files that are not commonly written
-to, such as application serving shares (ie. shares that contain common
-.EXE files - such as a Microsoft Office share) as it allows clients to
-read-ahread cache copies of these files. Samba can also fake oplocks, by granting a oplock whenever a client
-asks for one. This is controlled using the smb.conf option "fake
-oplocks". If you set "fake oplocks = yes" then you are telling the
-client that it may agressively cache the file data for all opens. Enabling 'fake oplocks' on all read-only shares or shares that you know
-will only be accessed from one client at a time you will see a big
-performance improvement on many operations. If you enable this option
-on shares where multiple clients may be accessing the files read-write
-at the same time you can get data corruption. Several people have done comparisons between Samba and Novell, NFS or
+WinNT. In some cases Samba performed the best, in others the worst. I
+suspect the biggest factor is not Samba vs some other system but the
+hardware and drivers used on the various systems. Given similar
+hardware Samba should certainly be competitive in speed with other
+systems. There are a number of socket options that can greatly affect the
performance of a TCP based server like Samba. The option "read size" affects the overlap of disk reads/writes with
network reads/writes. If the amount of data being transferred in
@@ -14857,9 +14950,9 @@ CLASS="SECT1"
> At startup the client and server negotiate a "maximum transmit" size,
which limits the size of nearly all SMB commands. You can set the
@@ -14880,331 +14973,626 @@ CLASS="SECT1"
> By default Samba does not implement strict locking on each read/write
-call (although it did in previous versions). If you enable strict
-locking (using "strict locking = yes") then you may find that you
-suffer a severe performance hit on some systems. The performance hit will probably be greater on NFS mounted
-filesystems, but could be quite high even on local disks. Some people find that opening files is very slow. This is often
-because of the "share modes" code needed to fully implement the dos
-share modes stuff. You can disable this code using "share modes =
-no". This will gain you a lot in opening and closing files but will
-mean that (in some cases) the system won't force a second user of a
-file to open the file read-only if the first has it open
-read-write. For many applications that do their own locking this
-doesn't matter, but for some it may. Most Windows applications
-depend heavily on "share modes" working correctly and it is
-recommended that the Samba share mode support be left at the
-default of "on". The share mode code in Samba has been re-written in the 1.9.17
-release following tests with the Ziff-Davis NetBench PC Benchmarking
-tool. It is now believed that Samba 1.9.17 implements share modes
-similarly to Windows NT. NOTE: In the most recent versions of Samba there is an option to use
-shared memory via mmap() to implement the share modes. This makes
-things much faster. See the Makefile for how to enable this. If you set the log level (also known as "debug level") higher than 2
-then you may suffer a large drop in performance. This is because the
-server flushes the log file after each operation, which can be very
-expensive. Some machines may find "write raw" slower than normal write, in which
+case you may wish to change this option. The "wide links" option is now enabled by default, but if you disable
-it (for better security) then you may suffer a performance hit in
-resolving filenames. The performance loss is lessened if you have
-"getwd cache = yes", which is now the default. I suspect that his PC's (386sx16 based) were asking for more data than
+they could chew. I suspect a similar speed could be had by setting
+"read raw = no" and "max xmit = 2048", instead of changing the
+protocol. Lowering the "read size" might also help. The "read raw" operation is designed to be an optimised, low-latency
-file read operation. A server may choose to not support it,
-however. and Samba makes support for "read raw" optional, with it
-being enabled by default. In some cases clients don't handle "read raw" very well and actually
-get lower performance using it than they get using the conventional
-read operations. So you might like to try "read raw = no" and see what happens on your
-network. It might lower, raise or not affect your performance. Only
-testing can really tell. The "write raw" operation is designed to be an optimised, low-latency
-file write operation. A server may choose to not support it,
-however. and Samba makes support for "write raw" optional, with it
-being enabled by default. Some machines may find "write raw" slower than normal write, in which
-case you may wish to change this option. Also note that some people have found that setting DefaultRcvWindow in
+the [MSTCP] section of the SYSTEM.INI file under WfWg to 3072 gives a
+big improvement. I don't know why. My own experience wth DefaultRcvWindow is that I get much better
+performance with a large value (16384 or larger). Other people have
+reported that anything over 3072 slows things down enourmously. One
+person even reported a speed drop of a factor of 30 when he went from
+3072 to 8192. I don't know why. It probably depends a lot on your hardware, and the type of unix box
+you have at the other end of the link. Paul Cochrane has done some testing on client side tuning and come
+to the following conclusions: Install the W2setup.exe file from www.microsoft.com. This is an
+update for the winsock stack and utilities which improve performance. Configure the win95 TCPIP registry settings to give better
+perfomance. I use a program called MTUSPEED.exe which I got off the
+net. There are various other utilities of this type freely available.
+The setting which give the best performance for me are: MaxMTU Remove RWIN Remove MTUAutoDiscover Disable MTUBlackHoleDetect Disable Time To Live Enabled Time To Live - HOPS 32 NDI Cache Size 0 I tried virtually all of the items mentioned in the document and
+the only one which made a difference to me was the socket options. It
+turned out I was better off without any!!!!! In terms of overall speed of transfer, between various win95 clients
+and a DX2-66 20MB server with a crappy NE2000 compatible and old IDE
+drive (Kernel 2.0.30). The transfer rate was reasonable for 10 baseT. I based these test on transfer two files a 4.5MB text file and a 15MB
+textfile. The results arn't bad considering the hardware Samba is
+running on. It's a crap machine!!!! The updates mentioned in 1 and 2 brought up the transfer rates from
+just over 100kB/s in some clients. A new client is a P333 connected via a 100MB/s card and hub. The
+transfer rates from this were good: 450-500kB/s on put and 600+kB/s
+on get. Looking at standard FTP throughput, Samba is a bit slower (100kB/s
+upwards). I suppose there is more going on in the samba protocol, but
+if it could get up to the rate of FTP the perfomance would be quite
+staggering. Samba can do read prediction on some of the SMB commands. Read
-prediction means that Samba reads some extra data on the last file it
-read while waiting for the next SMB command to arrive. It can then
-respond more quickly when the next read request arrives. This is disabled by default. You can enable it by using "read
-prediction = yes". Note that read prediction is only used on files that were opened read
-only. Read prediction should particularly help for those silly clients (such
-as "Write" under NT) which do lots of very small reads on a file. Samba will not read ahead more data than the amount specified in the
-"read size" option. It always reads ahead on 1k block boundaries. Unfortunately, the Resource Kit info is Win NT4/2K version specific. Here is a quick guide: On your NT4 Domain Controller, right click on 'My Computer', then
+select the tab labelled 'User Profiles'. Select a user profile you want to migrate and click on it. I am using the term "migrate" lossely. You can copy a profile to
+create a group profile. You can give the user 'Everyone' rights to the
+profile you copy this to. That is what you need to do, since your samba
+domain is not a member of a trust relationship with your NT4 PDC. Click the 'Copy To' button. In the box labelled 'Copy Profile to' add your new path, eg:
+c:\temp\foobar Click on the button labelled 'Change' in the "Permitted to use" box. Click on the group 'Everyone' and then click OK. This closes the
+'chose user' box. Now click OK. Follow the above for every profile you need to migrate. You should obtain the SID of your NT4 domain. You can use smbpasswd to do
+this. Read the man page. With Samba-3.0.0 alpha code you can import all you NT4 domain accounts
+using the net samsync method. This way you can retain your profile
+settings as well as all your users. The above method can be used to create mandatory profiles also. To convert
+a group profile into a mandatory profile simply locate the NTUser.DAT file
+in the copied profile and rename it to NTUser.MAN. Samba supports reading files via memory mapping them. One some
-machines this can give a large boost to performance, on others it
-makes not difference at all, and on some it may reduce performance. To enable you you have to recompile Samba with the -DUSE_MMAP option
-on the FLAGS line of the Makefile. Note that memory mapping is only used on files opened read only, and
-is not used by the "read raw" operation. Thus you may find memory
-mapping is more effective if you disable "read raw" using "read raw =
-no". One person has reported that setting the protocol to COREPLUS rather
-than LANMAN2 gave a dramatic speed improvement (from 10k/s to 150k/s). I suspect that his PC's (386sx16 based) were asking for more data than
-they could chew. I suspect a similar speed could be had by setting
-"read raw = no" and "max xmit = 2048", instead of changing the
-protocol. Lowering the "read size" might also help. Under the ProfileList key, there will be subkeys named with the SIDs of the
+users who have logged on to this computer. (To find the profile information
+for the user whose locally cached profile you want to move, find the SID for
+the user with the GetSID.exe utility.) Inside of the appropriate user's
+subkey, you will see a string value named ProfileImagePath. Slow logins are almost always due to the password checking time. Using
-the lowest practical "password level" will improve things a lot. You
-could also enable the "UFC crypt" option in the Makefile. Log on as the LOCAL workstation administrator. Right click on the 'My Computer' Icon, select 'Properties' Click on the 'User Profiles' tab Select the profile you wish to convert (click on it once) Click on the button 'Copy To' In the "Permitted to use" box, click on the 'Change' button. Click on the 'Look in" area that lists the machine name, when you click
+here it will open up a selection box. Click on the domain to which the
+profile must be accessible. Often a speed problem can be traced to the client. The client (for
-example Windows for Workgroups) can often be tuned for better TCP
-performance. See your client docs for details. In particular, I have heard rumours
-that the WfWg options TCPWINDOWSIZE and TCPSEGMENTSIZE can have a
-large impact on performance. Also note that some people have found that setting DefaultRcvWindow in
-the [MSTCP] section of the SYSTEM.INI file under WfWg to 3072 gives a
-big improvement. I don't know why. My own experience wth DefaultRcvWindow is that I get much better
-performance with a large value (16384 or larger). Other people have
-reported that anything over 3072 slows things down enourmously. One
-person even reported a speed drop of a factor of 30 when he went from
-3072 to 8192. I don't know why. It probably depends a lot on your hardware, and the type of unix box
-you have at the other end of the link. Paul Cochrane has done some testing on client side tuning and come
-to the following conclusions: Install the W2setup.exe file from www.microsoft.com. This is an
-update for the winsock stack and utilities which improve performance. Configure the win95 TCPIP registry settings to give better
-perfomance. I use a program called MTUSPEED.exe which I got off the
-net. There are various other utilities of this type freely available.
-The setting which give the best performance for me are: Samba works on a wide range of platforms but the interface all the
platforms provide is not always compatible. This chapter contains
@@ -15479,9 +15867,9 @@ CLASS="SECT1"
> HP's implementation of supplementary groups is, er, non-standard (for
hysterical reasons). There are two group files, /etc/group and
@@ -15509,9 +15897,9 @@ CLASS="SECT1"
>
If you run an old version of SCO Unix then you may need to get important
@@ -15526,9 +15914,9 @@ CLASS="SECT1"
> DNIX has a problem with seteuid() and setegid(). These routines are
needed for Samba to work correctly, but they were left out of the DNIX
@@ -15633,9 +16021,9 @@ CLASS="SECT1"
> By default RedHat Rembrandt-II during installation adds an
entry to /etc/hosts as follows:
@@ -15659,7 +16047,7 @@ CLASS="CHAPTER"
>Chapter 24. Samba and other CIFS clientsChapter 22. Samba and other CIFS clients This chapter contains client-specific information. Yes. A more complete answer to this question can be
@@ -15780,9 +16168,9 @@ CLASS="SECT2"
> You can use the free Microsoft LAN Manager 2.2c Client
@@ -15824,9 +16212,9 @@ CLASS="SECT2"
> When you do a NET VIEW or use the "File and Print
@@ -15846,9 +16234,9 @@ CLASS="SECT2"
> First, create a share called [PRINTDRV] that is
@@ -15897,17 +16285,17 @@ CLASS="SECT1"
> Use the latest TCP/IP stack from microsoft if you use Windows
for workgroups. WfWg does a lousy job with passwords. I find that if I change my
password on either the unix box or the PC the safest thing to do is to
@@ -15947,9 +16335,9 @@ CLASS="SECT2"
> There is a program call admincfg.exe
on the last disk (disk 8) of the WFW 3.11 disk set. To install it
@@ -15966,9 +16354,9 @@ CLASS="SECT2"
> Windows for Workgroups uppercases the password before sending it to the server. Unix passwords can be case-sensitive though. Check the When using Windows 95 OEM SR2 the following updates are recommended where Samba
is being used. Please NOTE that the above change will affect you once these
@@ -16033,9 +16421,9 @@ CLASS="SECT1"
>
There are several annoyances with Windows 2000 SP2. One of which
@@ -16117,15 +16505,15 @@ CLASS="CHAPTER"
>Chapter 25. Reporting BugsChapter 23. Reporting Bugs The email address for bug reports for stable releases is Before submitting a bug report check your config for silly
errors. Look in your log files for obvious messages that tell you that
@@ -16193,9 +16581,9 @@ CLASS="SECT1"
> If the bug has anything to do with Samba behaving incorrectly as a
server (like refusing to open a file) then the log files will probably
@@ -16263,9 +16651,9 @@ CLASS="SECT1"
> If you get a "INTERNAL ERROR" message in your log files it means that
Samba got an unexpected signal while running. It is probably a
@@ -16307,9 +16695,9 @@ CLASS="SECT1"
> Unfortunately some unixes (in particular some recent linux kernels)
refuse to dump a core file if the task has changed uid (which smbd
@@ -16324,9 +16712,9 @@ CLASS="SECT1"
> The best sort of bug report is one that includes a fix! If you send us
patches please use Chapter 26. Diagnosing your samba serverChapter 24. Diagnosing your samba server This file contains a list of tests you can perform to validate your
Samba server. It also tells you what the likely cause of the problem
@@ -16375,9 +16763,9 @@ CLASS="SECT1"
> In all of the tests it is assumed you have a Samba server called
BIGSERVER and a PC called ACLIENT both in workgroup TESTGROUP. In the directory in which you store your smb.conf file, run the command
"testparm smb.conf". If it reports any errors then your smb.conf
@@ -16443,9 +16831,9 @@ CLASS="SECT2"
> Run the command "ping BIGSERVER" from the PC and "ping ACLIENT" from
the unix box. If you don't get a valid response then your TCP/IP
@@ -16469,9 +16857,9 @@ CLASS="SECT2"
> Run the command "smbclient -L BIGSERVER" on the unix box. You
should get a list of available shares back. Run the command "nmblookup -B BIGSERVER __SAMBA__". You should get the
IP address of your Samba server back. run the command Run the command Run the command On the PC type the command Run the command Run the command From file manager try to browse the server. Your samba server should
appear in the browse list of your local workgroup (or the one you
@@ -16853,9 +17241,9 @@ CLASS="SECT1"
> Try the mailing list or newsgroup, or use the ethereal utility to
sniff the problem. The official samba mailing list can be reached at
--
cgit
|
---|