1<HTML> 2<HEAD> 3<TITLE> 4[Chapter 9] 9.2 The Fault Tree</title><META NAME="DC.title" CONTENT=""><META NAME="DC.creator" CONTENT=""><META NAME="DC.publisher" CONTENT="O'Reilly & Associates, Inc."><META NAME="DC.date" CONTENT="1999-11-05T21:36:27Z"><META NAME="DC.type" CONTENT="Text.Monograph"><META NAME="DC.format" CONTENT="text/html" SCHEME="MIME"><META NAME="DC.source" CONTENT="" SCHEME="ISBN"><META NAME="DC.language" CONTENT="en-US"><META NAME="generator" CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"></head> 5<BODY BGCOLOR="#FFFFFF" TEXT="#000000" link="#990000" vlink="#0000CC"> 6<table BORDER="0" CELLPADDING="0" CELLSPACING="0" width="90%"> 7<tr> 8<td width="25%" valign="TOP"> 9<img hspace=10 vspace=10 src="gifs/samba.s.gif" 10alt="Using Samba" align=left valign=top border=0> 11</td> 12<td height="105" valign="TOP"> 13<br> 14<H2>Using Samba</H2> 15<font size="-1"> 16Robert Eckstein, David Collier-Brown, Peter Kelly 17<br>1st Edition November 1999 18<br>1-56592-449-5, Order Number: 4495 19<br>416 pages, $34.95 20</font> 21<p> <a href="http://www.oreilly.com/catalog/samba/">Buy the hardcopy</a> 22<p><a href="index.html">Table of Contents</a> 23</td> 24</tr> 25</table> 26<hr size=1 noshade> 27<!--sample chapter begins --> 28 29<center> 30<DIV CLASS="htmlnav"> 31<TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 32<TR> 33<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 34<A CLASS="sect1" HREF="ch09_01.html" TITLE="9.1 The Tool Bag"> 35<IMG SRC="gifs/txtpreva.gif" ALT="Previous: 9.1 The Tool Bag" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 36<B> 37<FONT FACE="ARIEL,HELVETICA,HELV,SANSERIF" SIZE="-1"> 38<A CLASS="chapter" REL="up" HREF="ch09_01.html" TITLE="9. Troubleshooting Samba"> 39Chapter 9<br> 40Troubleshooting Samba</a></font></b></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 41<A CLASS="sect1" HREF="ch09_03.html" TITLE="9.3 Extra Resources"> 42<IMG SRC="gifs/txtnexta.gif" ALT="Next: 9.3 Extra Resources" BORDER="0"></a></td></tr></table> <hr noshade size=1></center> 43</div> 44<blockquote> 45<div> 46<H2 CLASS="sect1"> 47<A CLASS="title" NAME="ch09-29538"> 489.2 The Fault Tree</a></h2><P CLASS="para">The fault tree is for diagnosing and fixing problems that occur when you're installing and reconfiguring Samba. It's an expanded form of a trouble and diagnostic document that is part of the Samba distribution.</p><P CLASS="para">Before you set out to troubleshoot any part of the Samba suite, you should know the following information:</p><UL CLASS="itemizedlist"> 49<LI CLASS="listitem"> 50<P CLASS="para"> 51<A CLASS="listitem" NAME="ch09-pgfId-945178"> 52</a> Your client IP address (we use 192.168.236.10) </p></li><LI CLASS="listitem"> 53<P CLASS="para"> 54<A CLASS="listitem" NAME="ch09-pgfId-945179"> 55</a> Your server IP address (we use 192.168.236.86) </p></li><LI CLASS="listitem"> 56<P CLASS="para"> 57<A CLASS="listitem" NAME="ch09-pgfId-945180"> 58</a> The netmask for your network (typically 255.255.255.0)</p></li><LI CLASS="listitem"> 59<P CLASS="para"> 60<A CLASS="listitem" NAME="ch09-pgfId-945181"> 61</a> Whether the machines are all on the same subnet (ours are)</p></li></ul><P CLASS="para"> 62For clarity, we've renamed the server in the following examples to <EM CLASS="emphasis"> 63server.example.com</em>, and the client machine to <EM CLASS="emphasis"> 64client.example.com</em>.</p><DIV CLASS="sect2"> 65<H3 CLASS="sect2"> 66<A CLASS="title" NAME="ch09-pgfId-945183"> 679.2.1 How to use the fault tree</a></h3><P CLASS="para">Start the tests here, without skipping forward; it won't take long (about five minutes) and may actually save you time backtracking. Whenever a test succeeds, you will be given a section name and page number to which you can safely skip.</p></div><DIV CLASS="sect2"> 68<H3 CLASS="sect2"> 69<A CLASS="title" NAME="ch09-pgfId-953555"> 709.2.2 Troubleshooting Low-level IP </a></h3><P CLASS="para">The first series of tests is that of the low-level services that Samba needs in order to run. The tests in this section will verify that:</p><UL CLASS="itemizedlist"> 71<LI CLASS="listitem"> 72<P CLASS="para"> 73<A CLASS="listitem" NAME="ch09-pgfId-945191"> 74</a> The IP software works</p></li><LI CLASS="listitem"> 75<P CLASS="para"> 76<A CLASS="listitem" NAME="ch09-pgfId-945192"> 77</a> The Ethernet hardware works</p></li><LI CLASS="listitem"> 78<P CLASS="para"> 79<A CLASS="listitem" NAME="ch09-pgfId-945193"> 80</a> Basic name service is in place</p></li></ul><P CLASS="para"> 81Subsequent sections will add TCP software, the Samba daemons <EM CLASS="emphasis"> 82smbd</em> and <EM CLASS="emphasis"> 83nmbd</em>, host-based access control, authentication and per-user access control, file services, and browsing. The tests are described in considerable detail in order to make them understandable by both technically oriented end users and experienced systems and network administrators.</p><DIV CLASS="sect3"> 84<H4 CLASS="sect3"> 85<A CLASS="title" NAME="ch09-pgfId-945197"> 869.2.2.1 Testing the networking software with ping </a></h4><P CLASS="para"> 87The first command to enter on both the server and the client is <CODE CLASS="literal"> 88ping 127.0.0.1</code>. This is the <I CLASS="firstterm"> 89loopback</i> <EM CLASS="emphasis"> 90address</em> and testing it will indicate whether any networking support is functioning at all. On Unix, you can use <CODE CLASS="literal"> 91ping</code> <CODE CLASS="literal"> 92127.0.0.1</code> with the statistics option and interrupt it after a few lines. On Sun workstations, the command is typically <CODE CLASS="literal"> 93/usr/etc/ping</code> <CODE CLASS="literal"> 94-s</code> <CODE CLASS="literal"> 95127.0.0.1</code>; on Linux, just <CODE CLASS="literal"> 96ping</code> <CODE CLASS="literal"> 97127.0.0.1</code>. On Windows clients, run <CODE CLASS="literal"> 98ping</code> <CODE CLASS="literal"> 99127.0.0.1</code> in an MS-DOS window and it will stop by itself after four lines.</p><P CLASS="para"> 100Here is an example on a Linux server:</p><PRE CLASS="programlisting"><B CLASS="emphasis.bold"><CODE CLASS="literal">server%</code> ping 127.0.0.1 </b> 101</pre><PRE CLASS="programlisting"> 102PING localhost: 56 data bytes 64 bytes from localhost (127.0.0.1): 103icmp-seq=0. time=1. ms 64 bytes from localhost (127.0.0.1): 104icmp-seq=1. time=0. ms 64 bytes from localhost (127.0.0.1): 105icmp-seq=2. time=1. ms ^C 106----127.0.0.1 PING Statistics---- 1073 packets transmitted, 3 packets received, 0% packet loss round-trip (ms) 108min/avg/max = 0/0/1 </pre><P CLASS="para"> 109If you get "ping: no answer from..." or "100% packet loss," you have no IP networking at all installed on the machine. The address <CODE CLASS="literal"> 110127.0.0.1</code> is the internal loopback address and doesn't depend on the computer being physically connected to a network. If this test fails, you have a serious local problem. TCP/IP either isn't installed or is seriously misconfigured. See your operating system documentation if it is a Unix server. If it is a Windows client, follow the instructions in <a href="ch03_01.html"><b>Chapter 3, <CITE CLASS="chapter">Configuring Windows Clients</cite></b></a>, to install networking support.</p><P CLASS="para"> 111If <EM CLASS="emphasis"> 112you're</em> the network manager, some good references are Craig Hunt's <EM CLASS="emphasis"> 113TCP/IP Network Administration</em>, Chapter 11, and Craig Hunt & Robert Bruce Thompson's new book, <EM CLASS="emphasis"> 114Windows NT TCP/IP Network Administration, </em>both published by O'Reilly.</p></div><DIV CLASS="sect3"> 115<H4 CLASS="sect3"> 116<A CLASS="title" NAME="ch09-20350"> 1179.2.2.2 Testing local name services with ping </a></h4><P CLASS="para">Next, try to ping <CODE CLASS="literal"> 118localhost</code> on the Samba server. <CODE CLASS="literal"> 119localhost</code> is the conventional hostname for the 127.0.0.1 loopback, and it should resolve to that address. After typing <CODE CLASS="literal"> 120ping</code> <CODE CLASS="literal"> 121localhost</code>, you should see output similar to the following:</p><PRE CLASS="programlisting"><B CLASS="emphasis.bold"><CODE CLASS="literal">server%</code> ping localhost </b> 122</pre><PRE CLASS="programlisting"> 123PING localhost: 56 data bytes 64 bytes from localhost (127.0.0.1): 124icmp-seq=0. time=0. ms 64 bytes from localhost (127.0.0.1): 125icmp-seq=1. time=0. ms 64 bytes from localhost (127.0.0.1): 126icmp-seq=2. time=0. ms ^C</pre><P CLASS="para"> 127If this succeeds, try the same test on the client. Otherwise:</p><UL CLASS="itemizedlist"> 128<LI CLASS="listitem"> 129<P CLASS="para"> 130<A CLASS="listitem" NAME="ch09-pgfId-951025"> 131</a>If you get "unknown host: localhost," there is a problem resolving the host name localhost into a valid IP address. (This may be as simple as a missing entry in a local <EM CLASS="emphasis"> 132hosts</em> file.) From here, skip down to the section <A CLASS="xref" HREF="ch09_02.html#ch09-23768"> 133Section 9.2.8, Troubleshooting Name Services</a>. </p></li><LI CLASS="listitem"> 134<P CLASS="para"> 135<A CLASS="listitem" NAME="ch09-pgfId-946775"> 136</a>If you get "ping: no answer," or "100% packet loss," but pinging 127.0.0.1 worked, then name services is resolving to an address, but it isn't the correct one. Check the file or database (typically <I CLASS="filename"> 137/etc/hosts</i> on a Unix system) that the name service is using to resolve addresses to ensure that the entry is corrected.</p></li></ul></div><DIV CLASS="sect3"> 138<H4 CLASS="sect3"> 139<A CLASS="title" NAME="ch09-pgfId-946776"> 1409.2.2.3 Testing the networking hardware with ping </a></h4><P CLASS="para">Next, ping the server's network IP address from itself. This should get you exactly the same results as pinging 127.0.0.1:</p><PRE CLASS="programlisting"><B CLASS="emphasis.bold"><CODE CLASS="literal">server%</code> ping 192.168.236.86 </b> 141</pre><PRE CLASS="programlisting"> 142PING 192.168.236.86: 56 data bytes 64 bytes from 192.168.236.86 (192.168.236.86): 143icmp-seq=0. time=1. ms 64 bytes from 192.168.236.86 (192.168.236.86): 144icmp-seq=1. time=0. ms 64 bytes from 192.168.236.86 (192.168.236.86): 145icmp-seq=2. time=1. ms ^C 146----192.168.236.86 PING Statistics---- 1473 packets transmitted, 3 packets received, 0% packet loss round-trip (ms) 148min/avg/max = 0/0/1</pre><P CLASS="para"> 149If this works on the server, repeat it for the client. Otherwise:</p><UL CLASS="itemizedlist"> 150<LI CLASS="listitem"> 151<P CLASS="para"> 152<A CLASS="listitem" NAME="ch09-pgfId-945243"> 153</a>If <CODE CLASS="literal"> 154ping</code> <CODE CLASS="replaceable"> 155<I> 156network_ip</i></code> fails on either the server or client, but ping 127.0.0.1 works on that machine, you have a TCP/IP problem that is specific to the Ethernet network interface card on the computer. Check with the documentation for the network card or the host operating system to determine how to correctly configure it. However, be aware that on some operating systems, the <EM CLASS="emphasis"> 157ping</em> command appears to work even if the network is disconnected, so this test doesn't always diagnose all hardware problems. </p></li></ul></div><DIV CLASS="sect3"> 158<H4 CLASS="sect3"> 159<A CLASS="title" NAME="ch09-84079"> 1609.2.2.4 Testing connections with ping</a></h4><P CLASS="para">Now, ping the server by name (instead of its IP address), once from the server and once from the client. This is the general test for working network hardware:</p><PRE CLASS="programlisting"><B CLASS="emphasis.bold"><CODE CLASS="literal">server%</code> ping server </b> 161</pre><PRE CLASS="programlisting"> 162PING server.example.com: 56 data bytes 64 bytes from server.example.com (192.168.236.86): 163icmp-seq=0. time=1. ms 64 bytes from server.example.com (192.168.236.86): 164icmp-seq=1. time=0. ms 64 bytes from server.example.com (192.168.236.86): 165icmp-seq=2. time=1. ms ^C 166----server.example.com PING Statistics---- 1673 packets transmitted, 3 packets received, 0% packet loss round-trip (ms) 168min/avg/max = 0/0/1</pre><P CLASS="para"> 169On Microsoft Windows, a ping of the server would look like <A CLASS="xref" HREF="ch09_02.html#ch09-91668"> 170Figure 9.1</a>. </p><H4 CLASS="figure"> 171<A CLASS="title" NAME="ch09-91668"> 172Figure 9.1: Pinging the Samba server from a Windows client</a></h4><IMG CLASS="graphic" SRC="figs/sam.0901.gif" ALT="Figure 9.1"><P CLASS="para"> 173If successful, this test tells us five things:</p><OL CLASS="orderedlist"> 174<LI CLASS="listitem"> 175<P CLASS="para"> 176<A CLASS="listitem" NAME="ch09-pgfId-946836"> 177</a>The hostname (e.g., "server") is being found by your local nameserver.</p></li><LI CLASS="listitem"> 178<P CLASS="para"> 179<A CLASS="listitem" NAME="ch09-pgfId-946837"> 180</a>The hostname has been expanded to the full name (e.g., <A CLASS="email" HREF="mailto:server.example.com" TITLE="server.example.com"> 181server.example.com</a>).</p></li><LI CLASS="listitem"> 182<P CLASS="para"> 183<A CLASS="listitem" NAME="ch09-pgfId-945264"> 184</a>Its address is being returned (192.168.236.86).</p></li><LI CLASS="listitem"> 185<P CLASS="para"> 186<A CLASS="listitem" NAME="ch09-pgfId-945265"> 187</a>The client has sent the Samba server four 56-byte UDP/IP packets.</p></li><LI CLASS="listitem"> 188<P CLASS="para"> 189<A CLASS="listitem" NAME="ch09-pgfId-945266"> 190</a>The Samba server has replied to all four packets.</p></li></ol><P CLASS="para"> 191If this test isn't successful, there can be one of several things wrong with the network:</p><UL CLASS="itemizedlist"> 192<LI CLASS="listitem"> 193<P CLASS="para"> 194<A CLASS="listitem" NAME="ch09-pgfId-945267"> 195</a>First, if you get "ping: no answer," or "100% packet loss," you're not connecting to the network, the other machine isn't connecting, or one of the addresses is incorrect. Check the addresses that the <CODE CLASS="literal"> 196ping</code> command reports on each machine, and ensure that they match the ones you set up initially.</p><P CLASS="para"> 197If not, there is at least one mismatched address between the two machines. Try entering the command <CODE CLASS="literal"> 198arp</code> <CODE CLASS="literal"> 199-a</code>, and see if there is an entry for the other machine. The <CODE CLASS="literal"> 200arp</code> command stands for the Address Resolution Protocol. The <CODE CLASS="literal"> 201arp</code> <CODE CLASS="literal"> 202-a</code> command lists all the addresses known on the local machine. Here are some things to try:</p></li><LI CLASS="listitem"> 203<P CLASS="para"> 204<A CLASS="listitem" NAME="ch09-pgfId-946854"> 205</a>If you receive a message like "192.168.236.86 at (incomplete)," the Ethernet address of 192.168.236.86 is unknown. This indicates a complete lack of connectivity, and you're likely having a problem at the very bottom of the TCP/IP Network Administration protocol stack, at the Ethernet-interface layer. This is discussed in Chapters 5 and 6 of <CITE CLASS="citetitle"> 206TCP/IP Network Administration </cite>(O'Reilly).</p></li><LI CLASS="listitem"> 207<P CLASS="para"> 208<A CLASS="listitem" NAME="ch09-pgfId-945274"> 209</a>If you receive a response similar to "server (192.168.236.86) at 8:0:20:12:7c:94," then the server has been reached at some time, or another machine is answering on its behalf. However, this means that <EM CLASS="emphasis"> 210ping</em> should have worked: you may have an intermittent networking or ARP problem.</p></li><LI CLASS="listitem"> 211<P CLASS="para"> 212<A CLASS="listitem" NAME="ch09-pgfId-945275"> 213</a>If the IP address from ARP doesn't match the addresses you expected, investigate and correct the addresses manually.</p></li><LI CLASS="listitem"> 214<P CLASS="para"> 215<A CLASS="listitem" NAME="ch09-pgfId-945284"> 216</a>If each machine can ping itself but not another, something is wrong on the network between them.</p></li><LI CLASS="listitem"> 217<P CLASS="para"> 218<A CLASS="listitem" NAME="ch09-pgfId-945287"> 219</a>If you get "ping: network unreachable" or "ICMP Host Unreachable," then you're not receiving an answer and there is likely more than one network involved.</p><P CLASS="para"> 220In principle, you shouldn't try to troubleshoot SMB clients and servers on different networks. Try to test a server and client on the same network. The three tests that follow assume you might be testing between two networks:</p></li><LI CLASS="listitem"> 221<P CLASS="para"> 222<A CLASS="listitem" NAME="ch09-pgfId-951057"> 223</a>First, perform the tests for no answer described earlier in this section. If this doesn't identify the problem, the remaining possibilities are the following: an address is wrong, your netmask is wrong, a network is down, or just possibly you've been stopped by a firewall.</p></li><LI CLASS="listitem"> 224<P CLASS="para"> 225<A CLASS="listitem" NAME="ch09-pgfId-951077"> 226</a>Check both the address and the netmasks on source and destination machines to see if something is obviously wrong. Assuming both machines really are on the same network, they both should have the same netmasks and <EM CLASS="emphasis"> 227ping</em> should report the correct addresses. If the addresses are wrong, you'll need to correct them. If they're right, the programs may be confused by an incorrect netmask. See <A CLASS="xref" HREF="ch09_02.html#ch09-21203"> 228Section 9.2.9.1, Netmasks</a>, later in this chapter.</p></li><LI CLASS="listitem"> 229<P CLASS="para"> 230<A CLASS="listitem" NAME="ch09-pgfId-945300"> 231</a>If the commands are still reporting that the network is unreachable and neither of the previous two conditions is in error, one network really may be unreachable from the other. This, too, is a network manager issue.</p></li><LI CLASS="listitem"> 232<P CLASS="para"> 233<A CLASS="listitem" NAME="ch09-pgfId-946936"> 234</a>If you get "ICMP Administratively Prohibited," you've struck a firewall of some sort or a misconfigured router. You will need to speak to your network security officer.</p></li><LI CLASS="listitem"> 235<P CLASS="para"> 236<A CLASS="listitem" NAME="ch09-pgfId-946938"> 237</a>If you get "ICMP Host redirect," and <EM CLASS="emphasis"> 238ping</em> reports packets getting through, this is generally harmless: you're simply being rerouted over the network.</p></li><LI CLASS="listitem"> 239<P CLASS="para"> 240<A CLASS="listitem" NAME="ch09-pgfId-945305"> 241</a>If you get a host redirect and no <EM CLASS="emphasis"> 242ping</em> responses, you are being redirected, but no one is responding. Treat this just like the "Network unreachable" response and check your addresses and netmasks.</p></li><LI CLASS="listitem"> 243<P CLASS="para"> 244<A CLASS="listitem" NAME="ch09-pgfId-945308"> 245</a>If you get "ICMP Host Unreachable from gateway <EM CLASS="emphasis"> 246gateway_name</em>," ping packets are being routed to another network, but the other machine isn't responding and the router is reporting the problem on its behalf. Again, treat this like a "Network unreachable" response and start checking addresses and netmasks.</p></li><LI CLASS="listitem"> 247<P CLASS="para"> 248<A CLASS="listitem" NAME="ch09-pgfId-946955"> 249</a>If you get "ping: unknown host <EM CLASS="emphasis"> 250hostname</em>," your machine's name is not known. This tends to indicate a name-service problem, which didn't affect <CODE CLASS="literal"> 251localhost</code>. Have a look at <A CLASS="xref" HREF="ch09_02.html#ch09-23768"> 252Section 9.2.8</a>, later in this chapter.</p></li><LI CLASS="listitem"> 253<P CLASS="para"> 254<A CLASS="listitem" NAME="ch09-pgfId-946959"> 255</a>If you get a partial success, with some pings failing but others succeeding, you either have an intermittent problem between the machines or an overloaded network. Ping for longer, and see if more than about 3 percent of the packets fail. If so, check it with your network manager: a problem may just be starting. However, if only a few fail, or if you happen to know some massive network program is running, don't worry unduly. Ping's ICMP (and UDP) are designed to drop occasional packets.</p></li><LI CLASS="listitem"> 256<P CLASS="para"> 257<A CLASS="listitem" NAME="ch09-pgfId-945319"> 258</a>If you get a response like "smtsvr.antares.net is alive" when you actually pinged <EM CLASS="emphasis"> 259client.example.com</em>, you're either using someone else's address or the machine has multiple names and addresses. If the address is wrong, name service is clearly the culprit; you'll need to change the address in the name service database to refer to the right machine. This is discussed in <A CLASS="xref" HREF="ch09_02.html#ch09-23768"> 260Section 9.2.8</a>, later in this chapter.</p><P CLASS="para"> 261Server machines are often <EM CLASS="emphasis"> 262multihomed</em> : connected to more than one network, with different names on each net. If you are getting a response from an unexpected name on a multihomed server, look at the address and see if it's on your network (see the section <A CLASS="xref" HREF="ch09_02.html#ch09-21203"> 263Section 9.2.9.1</a>, later in this chapter). If so, you should use that address, rather than one on a different network, for both performance and reliability reasons.</p><P CLASS="para"> 264Servers may also have multiple names for a single Ethernet address, especially if they are web servers. This is harmless, if otherwise startling. You probably will want to use the official (and permanent) name, rather than an alias which may change.</p></li><LI CLASS="listitem"> 265<P CLASS="para"> 266<A CLASS="listitem" NAME="ch09-pgfId-945333"> 267</a>If everything works, but the IP address reported is 127.0.0.1, you have a name service error. This typically occurs when a operating system installation program generates an <I CLASS="filename"> 268/etc/hosts</i> line similar to <CODE CLASS="literal"> 269127.0.0.1</code> <CODE CLASS="literal"> 270localhost</code> <EM CLASS="emphasis"> 271hostnamedomainname</em>. The localhost line should say <CODE CLASS="literal"> 272127.0.0.1</code> <CODE CLASS="literal"> 273localhost</code> or <CODE CLASS="literal"> 274127.0.0.1</code> <CODE CLASS="literal"> 275localhost</code> <CODE CLASS="literal"> 276loghost</code>. Correct it, lest it cause failures to negotiate who is the master browse list holder and who is the master browser. It can, also cause (ambiguous) errors in later tests.</p></li></ul><P CLASS="para"> 277If this worked from the server, repeat it from the client.</p></div></div><DIV CLASS="sect2"> 278<H3 CLASS="sect2"> 279<A CLASS="title" NAME="ch09-pgfId-945336">9.2.3 Troubleshooting TCP</a></h3><P CLASS="para">Now that you've tested IP, UDP, and a name service with <EM CLASS="emphasis"> 280ping</em>, it's time to test TCP. <EM CLASS="emphasis"> 281ping</em> and browsing use ICMP and UDP; file and print services (shares) use TCP. Both depend on IP as a lower layer and all four depend on name services. Testing TCP is most conveniently done using the FTP (file transfer protocol) program.</p><DIV CLASS="sect3"> 282<H4 CLASS="sect3"> 283<A CLASS="title" NAME="ch09-78512"> 2849.2.3.1 Testing TCP with FTP </a></h4><P CLASS="para"> 285Try connecting via FTP, once from the server to itself, and once from the client to the server: </p><PRE CLASS="programlisting"> 286server% <CODE CLASS="userinput"><B>ftp server</b></code> 287Connected to server.example.com. 288220 server.example.com FTP server (Version 6.2/OpenBSD/Linux-0.10) ready. 289 Name (server:davecb): 290331 Password required for davecb. 291Password: 292230 User davecb logged in. 293 ftp><CODE CLASS="userinput"><B> quit </b></code> 294221 Goodbye. </pre><P CLASS="para"> 295If this worked, skip to the section <A CLASS="xref" HREF="ch09_02.html#ch09-88968"> 296Section 9.2.4, Troubleshooting Server Daemons</a>. Otherwise:</p><UL CLASS="itemizedlist"> 297<LI CLASS="listitem"> 298<P CLASS="para"> 299<A CLASS="listitem" NAME="ch09-pgfId-945357"> 300</a>If you received the message "server: unknown host," then nameservice has failed. Go back to the corresponding <EM CLASS="emphasis"> 301ping</em> step, <A CLASS="xref" HREF="ch09_02.html#ch09-20350"> 302Section 9.2.2.2, Testing local name services with ping </a>, and rerun those tests to see why name lookup failed.</p></li><LI CLASS="listitem"> 303<P CLASS="para"> 304<A CLASS="listitem" NAME="ch09-pgfId-945362"> 305</a>If you received "ftp: connect: Connection refused," the machine isn't running an FTP daemon. This is mildly unusual on Unix servers. Optionally, you might try this test by connecting to the machine using telnet instead of FTP; the messages are very similar and telnet uses TCP as well.</p></li><LI CLASS="listitem"> 306<P CLASS="para"> 307<A CLASS="listitem" NAME="ch09-pgfId-945364"> 308</a>If there was a long pause, then "ftp: connect: Connection timed out," the machine isn't reachable. Return to the section <A CLASS="xref" HREF="ch09_02.html#ch09-84079"> 309Section 9.2.2.4, Testing connections with ping</a>.</p></li><LI CLASS="listitem"> 310<P CLASS="para"> 311<A CLASS="listitem" NAME="ch09-pgfId-945369"> 312</a>If you received "530 Logon Incorrect," you connected successfully, but you've just found a different problem. You likely provided an incorrect username or password. Try again, making sure you use your username from the Unix server and type your password correctly.</p></li></ul></div></div><DIV CLASS="sect2"> 313<H3 CLASS="sect2"> 314<A CLASS="title" NAME="ch09-88968"> 3159.2.4 Troubleshooting Server Daemons</a></h3><P CLASS="para">Once you've confirmed that TCP networking is working properly, the next step is to make sure the daemons are running on the server. This takes three separate tests because no single one of the following will decisively prove that they're working correctly.</p><P CLASS="para"> 316To be sure they're running, you need to find out if:</p><OL CLASS="orderedlist"> 317<LI CLASS="listitem"> 318<P CLASS="para"> 319<A CLASS="listitem" NAME="ch09-pgfId-945374"> 320</a>The daemon has started</p></li><LI CLASS="listitem"> 321<P CLASS="para"> 322<A CLASS="listitem" NAME="ch09-pgfId-945375"> 323</a>The daemons are registered or bound to a TCP/IP port by the operating system</p></li><LI CLASS="listitem"> 324<P CLASS="para"> 325<A CLASS="listitem" NAME="ch09-pgfId-945376"> 326</a>They're actually paying attention</p></li></ol><DIV CLASS="sect3"> 327<H4 CLASS="sect3"> 328<A CLASS="title" NAME="ch09-pgfId-947020"> 3299.2.4.1 Before you start</a></h4><P CLASS="para"> 330First, check the logs. If you've started the daemons, the message "smbd version <EM CLASS="emphasis"> 331some_number</em> started" should appear. If it doesn't, you will need to restart the Samba daemons.</p><P CLASS="para"> 332If the daemon reports that it has indeed started, look out for "bind failed on port 139 socket_addr=0 (Address already in use)". This means another daemon has been started on port 139 (<EM CLASS="emphasis">smbd</em>). Also, <EM CLASS="emphasis"> 333nmbd</em> will report a similar failure if it cannot bind to port 137. Either you've started them twice, or the <EM CLASS="emphasis"> 334inetd</em> server has tried to provide a daemon for you. If it's the latter, we'll diagnose that in a moment.</p></div><DIV CLASS="sect3"> 335<H4 CLASS="sect3"> 336<A CLASS="title" NAME="ch09-49239"> 3379.2.4.2 Looking for daemon processes with ps</a></h4><P CLASS="para"> 338Next, you need to see if the daemons have been started. Use the <CODE CLASS="literal"> 339ps</code> command on the server with the <CODE CLASS="literal"> 340long</code> option for your machine type (commonly <CODE CLASS="literal"> 341ps</code> <CODE CLASS="literal"> 342ax</code> or <CODE CLASS="literal"> 343ps</code> <CODE CLASS="literal"> 344-ef</code>), and see if you have either <EM CLASS="emphasis"> 345smbd</em> and <EM CLASS="emphasis"> 346nmbd</em> already running. This often looks like the following:</p><PRE CLASS="programlisting"><B CLASS="emphasis.bold"><CODE CLASS="literal">server%</code> ps ax</b> 347</pre><PRE CLASS="programlisting"> 348 PID TTY STAT TIME COMMAND 349 1 ? S 0:03 init [2] 350 2 ? SW 0:00 (kflushd) 351<EM CLASS="emphasis"> 352(...many lines of processes...)</em> 353 234 ? S 0:14 nmbd -D3 354 237 ? S 0:11 smbd -D3 355<EM CLASS="emphasis"> 356(...more lines, possibly including more smbd lines...) </em></pre><P CLASS="para"> 357This example illustrates that <EM CLASS="emphasis"> 358smbd</em> and <EM CLASS="emphasis"> 359nmbd</em> have already started as stand-alone daemons (the <CODE CLASS="literal"> 360-D</code> option) at log level 3.</p></div><DIV CLASS="sect3"> 361<H4 CLASS="sect3"> 362<A CLASS="title" NAME="ch09-pgfId-945392"> 3639.2.4.3 Looking for daemons bound to ports</a></h4><P CLASS="para"> 364Next, the daemons have to be registered with the operating system so they can get access to TCP/IP ports. The <CODE CLASS="literal"> 365netstat</code> command will tell you if this has been done. Run the command <CODE CLASS="literal"> 366netstat</code> <CODE CLASS="literal"> 367-a</code> on the server, and look for lines mentioning <CODE CLASS="literal"> 368netbios</code>, <CODE CLASS="literal"> 369137</code> or <CODE CLASS="literal"> 370139</code>:</p><PRE CLASS="programlisting"><B CLASS="emphasis.bold"><CODE CLASS="literal">server%</code> netstat -a </b> 371</pre><PRE CLASS="programlisting"> 372Active Internet connections (including servers) 373Proto Recv-Q Send-Q Local Address Foreign Address (state) 374udp 0 0 *.netbios- *.* 375tcp 0 0 *.netbios- *.* LISTEN 376tcp 8370 8760 server.netbios- client.1439 377ESTABLISHED </pre><P CLASS="para"> 378or:</p><PRE CLASS="programlisting"><B CLASS="emphasis.bold"><CODE CLASS="literal">server%</code> netstat -a </b> 379</pre><PRE CLASS="programlisting"> 380Active Internet connections (including servers) 381Proto Recv-Q Send-Q Local Address Foreign Address (state) 382udp 0 0 *.137 *.* 383tcp 0 0 *.139 *.* LISTEN 384tcp 8370 8760 server.139 client.1439 ESTABLISHED </pre><P CLASS="para"> 385Among many similar lines, there should be at least one UDP line for <CODE CLASS="literal"> 386*.netbios-</code> or <CODE CLASS="literal"> 387*.137</code>. This indicates that the <EM CLASS="emphasis"> 388nmbd</em> server is registered and (we hope) is waiting to answer requests. There should also be at least one TCP line mentioning <CODE CLASS="literal"> 389*.netbios-</code> or <CODE CLASS="literal"> 390*.139</code>, and it will probably be in the LISTENING state. This means that <EM CLASS="emphasis"> 391smbd</em> is up and listening for connections.</p><P CLASS="para"> 392There may be other TCP lines indicating connections from <EM CLASS="emphasis"> 393smbd</em> to clients, one for each client. These are usually in the ESTABLISHED state. If there are <EM CLASS="emphasis"> 394smbd</em> lines in the ESTABLISHED state, <EM CLASS="emphasis"> 395smbd</em> is definitely running. If there is only one line in the LISTENING state, we're not sure yet. If both of the lines is missing, a daemon has not succeeded in starting, so it's time to check the logs and then go back to <a href="ch02_01.html"><b>Chapter 2</b></a>.</p><P CLASS="para"> 396If there is a line for each client, it may be coming either from a Samba daemon or from the master IP daemon, <EM CLASS="emphasis"> 397inetd</em>. It's quite possible that your <EM CLASS="emphasis"> 398inetd</em> startup file contains lines that start Samba daemons without your realizing it; for instance, the lines may have been placed there if you installed Samba as part of a Linux distribution. The daemons started by <EM CLASS="emphasis"> 399inetd</em> prevent ours from running. This problem typically produces log messages such as "bind failed on port 139 socket_addr=0 (Address already in use)."</p><P CLASS="para"> 400Check your <I CLASS="filename"> 401/etc/inetd.conf</i> ; unless you're intentionally starting the daemons from there, there <EM CLASS="emphasis"> 402must not</em> be any <CODE CLASS="literal"> 403netbios-ns</code> (udp port 137) or <CODE CLASS="literal"> 404netbios-ssn</code> (tcp port 139) servers mentioned there. <EM CLASS="emphasis"> 405inetd</em> is a daemon that provides numerous services, controlled by entries in <EM CLASS="emphasis"> 406/etc/inetd.conf</em>. If your system is providing an SMB daemon via <EM CLASS="emphasis"> 407inetd</em>, there will be lines like the following in the file:</p><PRE CLASS="programlisting"> 408netbios-ssn stream tcp nowait root /usr/local/samba/bin/smbd smbd 409netbios-ns dgram udp wait root /usr/local/samba/bin/nmbd nmbd</pre></div><DIV CLASS="sect3"> 410<H4 CLASS="sect3"> 411<A CLASS="title" NAME="ch09-pgfId-945425"> 4129.2.4.4 Checking smbd with telnet</a></h4><P CLASS="para"> 413Ironically, the easiest way to test that the <EM CLASS="emphasis"> 414smbd</em> server is actually working is to send it a meaningless message and see if it rejects it. Try something like the following:</p><PRE CLASS="programlisting"><CODE CLASS="userinput"><B>echo hello | telnet localhost 139</b></code></pre><P CLASS="para"> 415This sends an erroneous but harmless message to <EM CLASS="emphasis"> 416smbd</em>. The <CODE CLASS="literal"> 417hello</code> message is important. Don't try telneting to the port and typing just anything; you'll probably just hang your process. <CODE CLASS="literal"> 418hello</code>, however, is generally a harmless message.</p><PRE CLASS="programlisting"><B CLASS="emphasis.bold"><CODE CLASS="literal">server%</code> echo "hello" | telnet localhost 139 </b> 419</pre><PRE CLASS="programlisting"> 420Trying 421Trying 192.168.236.86 ... 422Connected to localhost. Escape character is '^]'. 423Connection closed by foreign host. </pre><P CLASS="para"> 424If you get a "Connected" message followed by a "Connection closed" message, the test was a success. You have an <EM CLASS="emphasis"> 425smbd</em> daemon listening on the port and rejecting improper connection messages. On the other hand, if you get "telnet: connect: Connection refused," there is probably no daemon present. Check the logs and go back to <a href="ch01_01.html"><b>Chapter 2</b></a>.</p><P CLASS="para"> 426Regrettably, there isn't an easy test for <EM CLASS="emphasis"> 427nmbd</em>. If the <CODE CLASS="literal"> 428telnet</code> test and the <CODE CLASS="literal"> 429netstat</code> test both say that there is an <EM CLASS="emphasis"> 430smbd</em> running, there is a good chance that <CODE CLASS="literal"> 431netstat</code> will also be correct about <EM CLASS="emphasis"> 432nmbd</em> running.</p></div><DIV CLASS="sect3"> 433<H4 CLASS="sect3"> 434<A CLASS="title" NAME="ch09-67494"> 4359.2.4.5 Testing daemons with testparm</a></h4><P CLASS="para">Once you know there's a daemon, you should always run <CODE CLASS="literal"> 436testparm</code>, in hopes of getting:</p><PRE CLASS="programlisting"><B CLASS="emphasis.bold"><CODE CLASS="literal">server%</code> testparm </b> 437</pre><PRE CLASS="programlisting"> 438Load smb config files from /opt/samba/lib/smb.conf 439Processing section "[homes]" 440Processing section "[printers]" ... 441Processing section "[tmp]" 442Loaded services file OK. ... </pre><P CLASS="para"> 443The <CODE CLASS="literal"> 444testparm</code> program normally reports processing a series of sections, and responds with "Loaded services file OK" if it succeeds. If not, it will report one or more of the following messages, which will also appear in the logs as noted:</p><DL CLASS="variablelist"> 445<DT CLASS="term"> 446<EM CLASS="emphasis"> 447"Allow/Deny connection from account (n) to service"</em></dt><DD CLASS="listitem"> 448<P CLASS="para"> 449A <EM CLASS="emphasis"> 450testparm</em>-only message produced if you have valid/invalid user options set in your <EM CLASS="emphasis"> 451smb.conf</em>. You will want to make sure that you are on the valid user list, and that root, bin, etc., are on the invalid user list. If you don't, you will not be able to connect, or folks who shouldn't <EM CLASS="emphasis"> 452will</em> be able to.</p></dd><DT CLASS="term"> 453<EM CLASS="emphasis"> 454"Warning: You have some share names that are longer than eight chars"</em></dt><DD CLASS="listitem"> 455<P CLASS="para"> 456For anyone using Windows for Workgroups and older clients. They will fail to connect to shares with long names, producing an overflow message that sounds confusingly like a memory overflow.</p></dd><DT CLASS="term"> 457"Warning: [name] service MUST be printable!"</dt><DD CLASS="listitem"> 458<P CLASS="para"> 459A printer share lacks a <CODE CLASS="literal"> 460printable</code> <CODE CLASS="literal"> 461=</code> <CODE CLASS="literal"> 462yes</code> option.</p></dd><DT CLASS="term"> 463"No path in service name using [name]"</dt><DD CLASS="listitem"> 464<P CLASS="para"> 465A file share doesn't know which directory to provide to the user, or a print share doesn't know which directory to use for spooling. If no path is specified, the service will try to run with a path of <EM CLASS="emphasis"> 466/tmp</em>, which may not be what you want.</p></dd><DT CLASS="term"> 467"Note: Servicename is flagged unavailable"</dt><DD CLASS="listitem"> 468<P CLASS="para"> 469Just a reminder that you have used the <CODE CLASS="literal"> 470available</code> <CODE CLASS="literal"> 471=</code> <CODE CLASS="literal"> 472no</code> option in a share.</p></dd><DT CLASS="term"> 473"Can't find include file [name]" </dt><DD CLASS="listitem"> 474<P CLASS="para"> 475A configuration file referred to by an <CODE CLASS="literal"> 476include</code> option did not exist. If you were including the file unconditionally, this is an error and probably a serious one: the share will not have the configuration you intended. If you were including it based one of the <CODE CLASS="literal"> 477%</code> variables, such as <CODE CLASS="literal"> 478%a</code> (architecture), you will need to decide if, for example, a missing Windows for Workgroups configuration file is a problem. It often isn't.</p></dd><DT CLASS="term"> 479"Can't copy service name, unable to copy to itself"</dt><DD CLASS="listitem"> 480<P CLASS="para"> 481You tried to copy a <I CLASS="filename"> 482smb.conf</i> section into itself.</p></dd><DT CLASS="term"> 483"Unable to copy service - source not found: [name]"</dt><DD CLASS="listitem"> 484<P CLASS="para"> 485Indicates a missing or misspelled section in a <CODE CLASS="literal"> 486copy</code> <CODE CLASS="literal"> 487=</code> option.</p></dd><DT CLASS="term"> 488"Ignoring unknown parameter name" </dt><DD CLASS="listitem"> 489<P CLASS="para"> 490Typically indicates an obsolete, misspelled or unsupported option.</p></dd><DT CLASS="term"> 491"Global parameter name found in service section" </dt><DD CLASS="listitem"> 492<P CLASS="para"> 493Indicates a global-only parameter has been used in an individual share. Samba will ignore the parameter.</p></dd></dl><P CLASS="para"> 494After the <CODE CLASS="literal"> 495testparm</code> test, repeat it with (exactly) three parameters: the name of your <I CLASS="filename"> 496smb.conf</i> file, the name of your client, and its IP address:</p><PRE CLASS="programlisting">testparm <CODE CLASS="replaceable"><I>samba_directory</i></code>/lib/smb.conf client 192.168.236.10</pre><P CLASS="para"> 497This will run one more test that checks the host name and address against <CODE CLASS="literal"> 498host</code> <CODE CLASS="literal"> 499allow</code> and <CODE CLASS="literal"> 500host</code> <CODE CLASS="literal"> 501deny</code> options and may produce the "Allow/Deny connection from account account_name" to service message for the client machine. This message indicates you have valid/invalid host options in your <I CLASS="filename"> 502smb.conf</i>, and they prohibit access from the client machine. Entering <CODE CLASS="literal"> 503testparm</code> <CODE CLASS="literal"> 504/usr/local/lib/experimental.conf</code> is also an effective way to test an experimental <I CLASS="filename"> 505smb.conf</i> file before putting it into production.</p></div></div><DIV CLASS="sect2"> 506<H3 CLASS="sect2"> 507<A CLASS="title" NAME="ch09-pgfId-945478">9.2.5 Troubleshooting SMB Connections</a></h3><P CLASS="para">Now that you know the servers are up, you need to make sure that they're running properly. We start with the <I CLASS="filename"> 508smb.conf</i> file in the <CODE CLASS="replaceable"> 509<I> 510samba_directory</i></code><I CLASS="filename"> 511/lib</i> directory.</p><DIV CLASS="sect3"> 512<H4 CLASS="sect3"> 513<A CLASS="title" NAME="ch09-67928"> 5149.2.5.1 A minimal smb.conf file</a></h4><P CLASS="para"> 515In the following tests, we assume you have a <CODE CLASS="literal"> 516[temp]</code> share suitable for testing, plus at least one account. An <I CLASS="filename"> 517smb.conf</i> file that includes just these is:</p><PRE CLASS="programlisting"> 518[global] 519 workgroup = <CODE CLASS="replaceable"> 520<I> 521EXAMPLE</i></code> 522 security = user 523 browsable = yes 524 local master = yes 525[homes] 526 guest ok = no 527 browseble = no 528[temp] 529 path = /tmp 530 public = yes </pre><P CLASS="para"> 531A word of warning: the <CODE CLASS="literal"> 532public</code> <CODE CLASS="literal"> 533=</code> <CODE CLASS="literal"> 534yes</code> option in the <CODE CLASS="literal"> 535[temp]</code> share is just for testing. You probably don't want people without accounts to be able to store things on your Samba server, so you should comment it out when you're done.</p></div><DIV CLASS="sect3"> 536<H4 CLASS="sect3"> 537<A CLASS="title" NAME="ch09-40595"> 5389.2.5.2 Testing locally with smbclient</a></h4><P CLASS="para">The first test is to ensure the server can list its own services (shares). Run the command <CODE CLASS="literal"> 539smbclient</code> with a <CODE CLASS="literal"> 540-L</code> option of <CODE CLASS="literal"> 541localhost</code> to connect to itself, and a <CODE CLASS="literal"> 542-U</code> option of just <CODE CLASS="literal"> 543%</code> to specify the guest user. You should see the following: </p><PRE CLASS="programlisting">server% <CODE CLASS="userinput"><B>smbclient -L localhost -U% </b></code> 544Server time is Wed May 27 17:57:40 1998 Timezone is UTC-4.0 545Server=[localhost] 546User=[davecb] 547Workgroup=[EXAMPLE] 548Domain=[EXAMPLE] 549 Sharename Type Comment 550 --------- ----- ---------- 551 temp Disk 552 IPC$ IPC IPC Service (Samba 1.9.18) 553 homes Disk Home directories 554This machine does not have a browse list </pre><P CLASS="para"> 555If you received this output, move on to the next test, <A CLASS="xref" HREF="ch09_02.html#ch09-77154"> 556Section 9.2.5.3, Testing connections with smbclient</a>. On the other hand, if you receive an error, check the following:</p><UL CLASS="itemizedlist"> 557<LI CLASS="listitem"> 558<P CLASS="para"> 559<A CLASS="listitem" NAME="ch09-pgfId-950443"> 560</a>If you get "Get_hostbyname: unknown host localhost," either you've spelled its name wrong or there actually is a problem (which should have been seen back in <A CLASS="xref" HREF="ch09_02.html#ch09-20350"> 561Section 9.2.2.2</a>) In the latter case, move on to "Troubleshooting Name Services."</p></li><LI CLASS="listitem"> 562<P CLASS="para"> 563<A CLASS="listitem" NAME="ch09-pgfId-945526"> 564</a>If you get "Connect error: Connection refused," the server machine was found, but it wasn't running an <EM CLASS="emphasis"> 565nmbd</em> daemon. Skip back to <A CLASS="xref" HREF="ch09_02.html#ch09-88968"> 566Section 9.2.4</a>, and retest the daemons.</p></li><LI CLASS="listitem"> 567<P CLASS="para"> 568<A CLASS="listitem" NAME="ch09-pgfId-945531"> 569</a>If you get the message "Your server software is being unfriendly," the initial session request packet got a garbage response from the server. The server may have crashed or started improperly. The common causes of this can be discovered by scanning the logs for:</p><UL CLASS="itemizedlist"> 570<LI CLASS="listitem"> 571<P CLASS="para"> 572<A CLASS="listitem" NAME="ch09-pgfId-945533"> 573</a>Invalid command-line parameters to <EM CLASS="emphasis"> 574smbd</em>; see the <EM CLASS="emphasis"> 575smbd</em> manual page.</p></li><LI CLASS="listitem"> 576<P CLASS="para"> 577<A CLASS="listitem" NAME="ch09-pgfId-945534"> 578</a>A fatal problem with the <I CLASS="filename"> 579smb.conf</i> file that prevents the startup of <EM CLASS="emphasis"> 580smbd</em>. Always check your changes, as was done in the section <A CLASS="xref" HREF="ch09_02.html#ch09-67494"> 581Section 9.2.4.5, Testing daemons with testparm</a>.</p></li><LI CLASS="listitem"> 582<P CLASS="para"> 583<A CLASS="listitem" NAME="ch09-pgfId-947160"> 584</a>The directories where Samba keeps its log and lock files are missing.</p></li><LI CLASS="listitem"> 585<P CLASS="para"> 586<A CLASS="listitem" NAME="ch09-pgfId-947165"> 587</a>There is already a server on the port (139 for <EM CLASS="emphasis"> 588smbd</em>, 137 for <EM CLASS="emphasis"> 589nmbd </em>), preventing it from starting.</p></li></ul></li><LI CLASS="listitem"> 590<P CLASS="para"> 591<A CLASS="listitem" NAME="ch09-pgfId-945543"> 592</a>If you're using <EM CLASS="emphasis"> 593inetd</em> instead of stand-alone daemons, check your <I CLASS="filename"> 594/etc/inetd.conf</i> and <I CLASS="filename"> 595/etc/services</i> entries against their manual pages for errors as well.</p></li><LI CLASS="listitem"> 596<P CLASS="para"> 597<A CLASS="listitem" NAME="ch09-pgfId-945544"> 598</a>If you get a <CODE CLASS="literal"> 599Password:</code> prompt, your guest account is not set up properly. The <CODE CLASS="literal"> 600%U</code> option tells <EM CLASS="emphasis"> 601smbclient</em> to do a "null login," which requires that the guest account be present but does not require it to have any privileges.</p></li><LI CLASS="listitem"> 602<P CLASS="para"> 603<A CLASS="listitem" NAME="ch09-pgfId-947172"> 604</a>If you get the message "SMBtconX failed. ERRSRV - ERRaccess," you aren't permitted access to the server. This normally means you have a <CODE CLASS="literal"> 605valid</code> <CODE CLASS="literal"> 606hosts</code> option that doesn't include the server, or an <CODE CLASS="literal"> 607invalid</code> <CODE CLASS="literal"> 608hosts</code> option that does. Recheck with the command <CODE CLASS="literal"> 609testparm</code> <CODE CLASS="literal"> 610smb.conf</code> <CODE CLASS="replaceable"> 611<I> 612your_hostname</i></code> <CODE CLASS="replaceable"> 613<I> 614your_ip_address</i></code> (see the section <A CLASS="xref" HREF="ch09_02.html#ch09-67494"> 615Section 9.2.4.5</a>) and correct any unintended prohibitions. </p></li></ul></div><DIV CLASS="sect3"> 616<H4 CLASS="sect3"> 617<A CLASS="title" NAME="ch09-77154"> 6189.2.5.3 Testing connections with smbclient</a></h4><P CLASS="para">Run the command <CODE CLASS="literal"> smbclient</code><CODE CLASS="literal">\\</code><CODE CLASS="replaceable"><I>server</i></code><CODE CLASS="literal">\temp</code>, which connects to your server's <I CLASS="filename"> 619/tmp</i> share, to see if you can connect to a file service. You should get the following response:</p><PRE CLASS="programlisting"><B CLASS="emphasis.bold"><CODE CLASS="literal">server% </code>smbclient '\\server\temp' </b> 620</pre><PRE CLASS="programlisting"> 621Server time is Tue May 5 09:49:32 1998 Timezone is UTC-4.0 Password: 622<B CLASS="emphasis.bold"><CODE CLASS="literal"> 623smb:\></code> quit</b></pre><UL CLASS="itemizedlist"> 624<LI CLASS="listitem"> 625<P CLASS="para"> 626<A CLASS="listitem" NAME="ch09-pgfId-947183"> 627</a>If you get "Get_Hostbyname: Unknown host name," "Connect error: Connection refused," or "Your server software is being unfriendly," see the section <A CLASS="xref" HREF="ch09_02.html#ch09-40595"> 628Section 9.2.5.2, Testing locally with smbclient</a> for the diagnoses.</p></li><LI CLASS="listitem"> 629<P CLASS="para"> 630<A CLASS="listitem" NAME="ch09-pgfId-947188"> 631</a>If you get the message "servertemp: Not enough `\' characters in service," you likely didn't quote the address, so Unix stripped off backslashes. You can also write the command:</p></li></ul><PRE CLASS="programlisting"><CODE CLASS="literal">smbclient</code> <CODE CLASS="literal">\\\\</code><CODE CLASS="replaceable"><I>server</i></code><CODE CLASS="literal">\\temp</code> </pre><P CLASS="para"> 632or: </p><PRE CLASS="programlisting">smbclient //<CODE CLASS="replaceable"><I>server</i></code>/temp </pre><P CLASS="para"> 633Now, provide your Unix account password to the <CODE CLASS="literal"> 634Password</code> prompt. If you then get an <CODE CLASS="literal"> 635smb\></code> prompt, it worked. Enter <CODE CLASS="literal"> 636quit</code>, and continue on to <A CLASS="xref" HREF="ch09_02.html#ch09-97081"> 637Section 9.2.5.4, Testing connections with NET USE</a>. If you then get "SMBtconX failed. ERRSRV - ERRinvnetname," the problem can be any of the following:</p><UL CLASS="itemizedlist"> 638<LI CLASS="listitem"> 639<P CLASS="para"> 640<A CLASS="listitem" NAME="ch09-pgfId-947201"> 641</a>A wrong share name: you may have spelled it wrong, it may be too long, it may be in mixed case, or it may not be available. Check that it's what you expect with testparm (see the section <A CLASS="xref" HREF="ch09_02.html#ch09-67494"> 642Section 9.2.4.5</a>.)</p></li><LI CLASS="listitem"> 643<P CLASS="para"> 644<A CLASS="listitem" NAME="ch09-pgfId-947205"> 645</a><CODE CLASS="literal"> 646security</code> <CODE CLASS="literal"> 647=</code> <CODE CLASS="literal"> 648share</code>, in which you may have to add <CODE CLASS="replaceable"> 649<I> 650-U your_account</i></code> to the <EM CLASS="emphasis"> 651smbclient</em> command, or know the password of a Unix account named temp. </p></li><LI CLASS="listitem"> 652<P CLASS="para"> 653<A CLASS="listitem" NAME="ch09-pgfId-945578"> 654</a>An erroneous username.</p></li><LI CLASS="listitem"> 655<P CLASS="para"> 656<A CLASS="listitem" NAME="ch09-pgfId-945579"> 657</a>An erroneous password.</p></li><LI CLASS="listitem"> 658<P CLASS="para"> 659<A CLASS="listitem" NAME="ch09-pgfId-945580"> 660</a>An <CODE CLASS="literal"> 661invalid</code> <CODE CLASS="literal"> 662users</code> or <CODE CLASS="literal"> 663valid</code> <CODE CLASS="literal"> 664users</code> option in your <EM CLASS="emphasis"> 665smb.conf</em> file that doesn't allow your account to connect. Recheck with <CODE CLASS="literal"> 666testparm</code> <CODE CLASS="literal"> 667smb.conf</code> <CODE CLASS="replaceable"> 668<I> 669your_hostname your_ip_address</i></code> (see <A CLASS="xref" HREF="ch09_02.html#ch09-67494"> 670Section 9.2.4.5</a>).</p></li><LI CLASS="listitem"> 671<P CLASS="para"> 672<A CLASS="listitem" NAME="ch09-pgfId-945584"> 673</a>A <CODE CLASS="literal"> 674valid</code> <CODE CLASS="literal"> 675hosts</code> option that doesn't include the server, or an <CODE CLASS="literal"> 676invalid</code> <CODE CLASS="literal"> 677hosts</code> option that does. Also test this with <EM CLASS="emphasis"> 678testparm</em>.</p></li><LI CLASS="listitem"> 679<P CLASS="para"> 680<A CLASS="listitem" NAME="ch09-pgfId-945585"> 681</a>A problem in authentication, such as if shadow passwords or the PAM (Password Authentication Module) is used on the server, but Samba is not compiled to use it. This is rare, but occasionally happens when a SunOS 4 Samba binary (no shadow passwords) is run without recompilation on a Solaris system (with shadow passwords).</p></li><LI CLASS="listitem"> 682<P CLASS="para"> 683<A CLASS="listitem" NAME="ch09-pgfId-945586"> 684</a>The <CODE CLASS="literal"> 685encrypted</code> <CODE CLASS="literal"> 686passwords</code> <CODE CLASS="literal"> 687=</code> <CODE CLASS="literal"> 688yes</code> option in the configuration file, but no password for your account in the <EM CLASS="emphasis"> 689smbpasswd</em> file.</p></li><LI CLASS="listitem"> 690<P CLASS="para"> 691<A CLASS="listitem" NAME="ch09-pgfId-945587"> 692</a>You have a null password entry, either in Unix <I CLASS="filename"> 693/etc/passwd</i> or in the <EM CLASS="emphasis"> 694smbpasswd</em> file.</p></li><LI CLASS="listitem"> 695<P CLASS="para"> 696<A CLASS="listitem" NAME="ch09-pgfId-945588"> 697</a>You are connecting to <CODE CLASS="literal"> 698[temp]</code>, and you do not have the <CODE CLASS="literal"> 699guest</code> <CODE CLASS="literal"> 700ok</code> <CODE CLASS="literal"> 701=</code> <CODE CLASS="literal"> 702yes</code> option in the <CODE CLASS="literal"> 703[temp]</code> section of the <EM CLASS="emphasis"> 704smb.conf</em> file.</p></li><LI CLASS="listitem"> 705<P CLASS="para"> 706<A CLASS="listitem" NAME="ch09-pgfId-947992"> 707</a>You are connecting to <CODE CLASS="literal"> 708[temp]</code> before connecting to your home directory, and your guest account isn't set up correctly. If you can connect to your home directory and then connect to <CODE CLASS="literal"> 709[temp]</code>, that's the problem. See <a href="ch02_01.html"><b>Chapter 2</b></a> for more information on creating a basic Samba configuration file.</p><P CLASS="para"> 710A bad guest account will also prevent you from printing or browsing until after you've logged in to your home directory. </p></li></ul><P CLASS="para"> 711There is one more reason for this failure that has nothing at all to do with passwords: the <CODE CLASS="literal"> 712path</code> <CODE CLASS="literal"> 713=</code> line in your <I CLASS="filename"> 714smb.conf</i> file may point somewhere that doesn't exist. This will not be diagnosed by <EM CLASS="emphasis"> 715testparm</em>, and most SMB clients can't tell it from other types of bad user accounts. You will have to check it manually.</p><P CLASS="para"> 716Once you have connected to <CODE CLASS="literal"> 717[temp]</code> successfully, repeat the test, this time logging in to your home directory (e.g., map network drive <CODE CLASS="replaceable"> 718<I> 719server</i></code><CODE CLASS="literal"> 720\davecb</code>) looking for failures in doing that. If you have to change anything to get that to work, re-test <CODE CLASS="literal"> 721[temp]</code> again afterwards.</p></div><DIV CLASS="sect3"> 722<H4 CLASS="sect3"> 723<A CLASS="title" NAME="ch09-97081"> 7249.2.5.4 Testing connections with NET USE</a></h4><P CLASS="para">Run the command <CODE CLASS="literal"> 725net</code> <CODE CLASS="literal">use</code> <CODE CLASS="literal">* </code><CODE CLASS="literal">\</code><CODE CLASS="replaceable"><I>server</i></code><CODE CLASS="literal">\temp</code> on the DOS or Windows client to see if it can connect to the server. You should be prompted for a password, then receive the response "The command was completed successfully," as shown in <A CLASS="xref" HREF="ch09_02.html#ch09-99328"> 726Figure 9.2</a>. </p><H4 CLASS="figure"> 727<A CLASS="title" NAME="ch09-99328"> 728Figure 9.2: Results of the NET USE command</a></h4><IMG CLASS="graphic" SRC="figs/sam.0902.gif" ALT="Figure 9.2"><P CLASS="para"> 729If that succeeded, continue with the steps in the section <A CLASS="xref" HREF="ch09_02.html#ch09-57065"> 730Section 9.2.5.5, Testing connections with Windows Explorer</a>. Otherwise:</p><UL CLASS="itemizedlist"> 731<LI CLASS="listitem"> 732<P CLASS="para"> 733<A CLASS="listitem" NAME="ch09-pgfId-945608"> 734</a>If you get "The specified shared directory cannot be found," or "Cannot locate specified share name," the directory name is either misspelled or not in the <EM CLASS="emphasis"> 735smb.conf</em> file. This message can also warn of a name in mixed case, including spaces, or is longer than eight characters.</p></li><LI CLASS="listitem"> 736<P CLASS="para"> 737<A CLASS="listitem" NAME="ch09-pgfId-945610"> 738</a>If you get "The computer name specified in the network path cannot be located," or "Cannot locate specified computer," the directory name has been misspelled, the name service has failed, there is a networking problem, or the <CODE CLASS="literal"> 739hosts</code> <CODE CLASS="literal"> 740deny</code> <CODE CLASS="literal"> 741=</code> option includes your host.</p><UL CLASS="itemizedlist"> 742<LI CLASS="listitem"> 743<P CLASS="para"> 744<A CLASS="listitem" NAME="ch09-pgfId-945612"> 745</a>If it is not a spelling mistake, you need to double back to at least the section <A CLASS="xref" HREF="ch09_02.html#ch09-77154"> 746Section 9.2.5.3</a>, to investigate why it doesn't connect.</p></li><LI CLASS="listitem"> 747<P CLASS="para"> 748<A CLASS="listitem" NAME="ch09-pgfId-945617"> 749</a>If <EM CLASS="emphasis"> 750smbclient</em> does work, it's a name service problem with the client name service, and you need to go forward to the section <A CLASS="xref" HREF="ch09_02.html#ch09-12446"> 751Section 9.2.6.2, Testing the server with nmblookup</a>, and see if you can look up both client and server with <EM CLASS="emphasis"> 752nmblookup</em>.</p></li></ul></li><LI CLASS="listitem"> 753<P CLASS="para"> 754<A CLASS="listitem" NAME="ch09-pgfId-945622"> 755</a>If you get "The password is invalid for <CODE CLASS="literal">\</code><CODE CLASS="replaceable"><I>server</i></code><CODE CLASS="literal">\</code><CODE CLASS="replaceable"><I>username</i></code>," your locally cached copy on the client doesn't match the one on the server. You will be prompted for a replacement.</p></li></ul><P CLASS="para"> 756Windows 95 and 98 clients keep a local <EM CLASS="emphasis"> 757password</em> file, but it's really just a cached copy of the password it sends to Samba and NT servers to authenticate you. That's what is being prompted for here. You can still log on to a Windows machine without a password (but not to NT).</p><UL CLASS="itemizedlist"> 758<LI CLASS="listitem"> 759<P CLASS="para"> 760If you provide your password, and it still fails, your password is not being matched on the server, you have a <CODE CLASS="literal"> 761valid</code> <CODE CLASS="literal"> 762users</code> or <CODE CLASS="literal"> 763invalid</code> <CODE CLASS="literal"> 764users</code> list denying you permission, NetBEUI is interfering, or the encrypted password problem described in the next paragraph exists.</p></li><LI CLASS="listitem"> 765<P CLASS="para"> 766<A CLASS="listitem" NAME="ch09-pgfId-945627"> 767</a>If your client is NT 4.0, NT 3.5 with Patch 3, Windows 95 with Patch 3, Windows 98 or any of these with Internet Explorer 4.0, these default to using Microsoft encryption for passwords (discussed in <a href="ch06_01.html"><b>Chapter 6, <CITE CLASS="chapter">Users, Security, and Domains</cite></b></a>'s <a href="ch06_04.html"><b>Section 6.4, Passwords</b> in <b>Chapter 6</b></a> section, along with the alternatives). In general, if you have installed a major Microsoft product recently, you may have applied an update and turned on encrypted passwords.</p></li></ul><P CLASS="para"> 768Because of Internet Explorer's willingness to honor URLs such as <I CLASS="filename"> 769file://somehost/somefile</i> by making SMB connections, clients up to and including Windows 95 Patch Level 2 would happily send your password, in plaintext, to SMB servers anywhere on the Internet. This was considered a bad idea, and Microsoft quite promptly switched to using only encrypted passwords in the SMB protocol. All subsequent releases of their products have included this correction. Encrypted passwords aren't actually needed unless you're using Internet Explorer 4.0 without a firewall, so it's reasonable to keep using unencrypted passwords on your own networks.</p><UL CLASS="itemizedlist"> 770<LI CLASS="listitem"> 771<P CLASS="para"> 772<A CLASS="listitem" NAME="ch09-pgfId-953889"> 773</a>If you have a mixed-case password on Unix, the client is probably sending it in all one case. If changing your password to all one case works, this was the problem. Regrettably, all but the oldest clients support uppercase passwords, so Samba will try once with it in uppercase and once in lower case. If you wish to use mixed-case passwords, see the <CODE CLASS="literal"> 774password</code> <CODE CLASS="literal"> 775level</code> option in <a href="ch06_01.html"><b>Chapter 6</b></a> for a workaround.</p></li><LI CLASS="listitem"> 776<P CLASS="para"> 777<A CLASS="listitem" NAME="ch09-pgfId-953895"> 778</a>You may have a <CODE CLASS="literal"> 779valid</code> <CODE CLASS="literal"> 780users</code> problem, as tested with <EM CLASS="emphasis"> 781smbclient</em> (see <A CLASS="xref" HREF="ch09_02.html#ch09-77154"> 782Section 9.2.5.3</a>).</p></li><LI CLASS="listitem"> 783<P CLASS="para"> 784<A CLASS="listitem" NAME="ch09-pgfId-945642"> 785</a>You may have the NetBEUI protocol bound to the Microsoft client. This often produces long timeouts and erratic failures, and is known to have caused failures to accept passwords in the past.</p></li></ul><P CLASS="para"> 786The term "bind" is used to mean connecting a piece of software to another in this case. The Microsoft SMB client is "bound to" TCP/IP in the bindings section of the TCP/IP properties panel under the Windows 95/98 Network icon in the Control Panel. TCP/IP in turn is bound to an Ethernet card. This is not the same sense of the word as binding an SMB daemon to a TCP/IP port.</p></div><DIV CLASS="sect3"> 787<H4 CLASS="sect3"> 788<A CLASS="title" NAME="ch09-57065">9.2.5.5 Testing connections with Windows Explorer</a></h4><P CLASS="para">Start Windows Explorer or NT Explorer (not Internet Explorer), select Tools→Map Network Drive and specify \\<CODE CLASS="replaceable"> 789<I> 790server</i></code>\<CODE CLASS="literal"> 791temp</code> to see if you can make Explorer connect to the <I CLASS="filename"> 792/tmp</i> directory. You should see a screen similar to the one in <A CLASS="xref" HREF="ch09_02.html#ch09-74414"> 793Figure 9.3</a>. If so, you've succeeded and can skip to <A CLASS="xref" HREF="ch09_02.html#ch09-23573"> 794Section 9.2.6, Troubleshooting Browsing </a>. </p><H4 CLASS="figure"> 795<A CLASS="title" NAME="ch09-74414"> 796Figure 9.3: Accessing the /tmp directory with Windows Explorer</a></h4><IMG CLASS="graphic" SRC="figs/sam.0903.gif" ALT="Figure 9.3"><P CLASS="para"> 797A word of caution: Windows Explorer and NT Explorer are rather poor as diagnostic tools: they do tell you that something's wrong, but rarely what it is. If you get a failure, you'll need to track it down with the NET USE command, which has far superior error reporting:</p><UL CLASS="itemizedlist"> 798<LI CLASS="listitem"> 799<P CLASS="para"> 800<A CLASS="listitem" NAME="ch09-pgfId-945661"> 801</a>If you get "The password for this connection that is in your password file is no longer correct," you may have any of the following:</p><UL CLASS="itemizedlist"> 802<LI CLASS="listitem"> 803<P CLASS="para"> 804<A CLASS="listitem" NAME="ch09-pgfId-945662"> 805</a>Your locally cached copy on the client doesn't match the one on the server.</p></li><LI CLASS="listitem"> 806<P CLASS="para"> 807<A CLASS="listitem" NAME="ch09-pgfId-945663"> 808</a>You didn't provide a username and password when logging on to the client. Most Explorers will continue to send a username and password of null, even if you provide a password.</p></li><LI CLASS="listitem"> 809<P CLASS="para"> 810<A CLASS="listitem" NAME="ch09-pgfId-945664"> 811</a>You have misspelled the password.</p></li><LI CLASS="listitem"> 812<P CLASS="para"> 813<A CLASS="listitem" NAME="ch09-pgfId-945665"> 814</a>You have an <CODE CLASS="literal"> 815invalid</code> <CODE CLASS="literal"> 816users</code> or <CODE CLASS="literal"> 817valid</code> <CODE CLASS="literal"> 818users</code> list denying permission.</p></li><LI CLASS="listitem"> 819<P CLASS="para"> 820<A CLASS="listitem" NAME="ch09-pgfId-945666"> 821</a>Your client is NT 4.0, NT 3.5 with Patch 3, Windows 95 with Patch 3, Windows 98, or any of these with Internet Explorer 4. They will all want encrypted passwords.</p></li><LI CLASS="listitem"> 822<P CLASS="para"> 823<A CLASS="listitem" NAME="ch09-pgfId-945667"> 824</a>You have a mixed-case password, which the client is supplying in all one case.</p></li></ul></li><LI CLASS="listitem"> 825<P CLASS="para"> 826<A CLASS="listitem" NAME="ch09-pgfId-945669"> 827</a>If you get "The network name is either incorrect, or a network to which you do not have full access," or "Cannot locate specified computer," you may have any of the following:</p><UL CLASS="itemizedlist"> 828<LI CLASS="listitem"> 829<P CLASS="para"> 830<A CLASS="listitem" NAME="ch09-pgfId-945671"> 831</a> Misspelled name</p></li><LI CLASS="listitem"> 832<P CLASS="para"> 833<A CLASS="listitem" NAME="ch09-pgfId-945672"> 834</a> Malfunctioning service </p></li><LI CLASS="listitem"> 835<P CLASS="para"> 836<A CLASS="listitem" NAME="ch09-pgfId-945673"> 837</a> Failed share</p></li><LI CLASS="listitem"> 838<P CLASS="para"> 839<A CLASS="listitem" NAME="ch09-pgfId-945674"> 840</a> Networking problem</p></li><LI CLASS="listitem"> 841<P CLASS="para"> 842<A CLASS="listitem" NAME="ch09-pgfId-945675"> 843</a> Bad <CODE CLASS="literal"> 844path</code> line</p></li><LI CLASS="listitem"> 845<P CLASS="para"> 846<A CLASS="listitem" NAME="ch09-pgfId-945676"> 847</a> <CODE CLASS="literal"> 848hosts</code> <CODE CLASS="literal"> 849deny</code> line that excludes you</p></li></ul></li><LI CLASS="listitem"> 850<P CLASS="para"> 851<A CLASS="listitem" NAME="ch09-pgfId-945677"> 852</a>If you get "You must supply a password to make this connection," the password on the client is out of synchronization with the server, or this is the first time you've tried from this client machine and the client hasn't cached it locally yet.</p></li><LI CLASS="listitem"> 853<P CLASS="para"> 854<A CLASS="listitem" NAME="ch09-pgfId-945681"> 855</a>If you get "Cannot locate specified share name," you have a wrong share name or a syntax error in specifying it, a share name longer than eight characters, or one containing spaces or in mixed case.</p></li></ul><P CLASS="para"> 856Once you can reliably connect to the <CODE CLASS="literal"> 857[temp]</code> directory, try once again, this time using your home directory. If you have to change something to get home directories working, then retest with <CODE CLASS="literal"> 858[temp]</code>, and vice versa, as we showed in the section <A CLASS="xref" HREF="ch09_02.html#ch09-97081"> 859Section 9.2.5.4</a>. As always, if Explorer fails, drop back to that section and debug it there.</p></div></div><DIV CLASS="sect2"> 860<H3 CLASS="sect2"> 861<A CLASS="title" NAME="ch09-23573">9.2.6 Troubleshooting Browsing </a></h3><P CLASS="para">Finally, we come to browsing. This was left to last, not because it is hardest, but because it's both optional and partially dependent on a protocol that doesn't guarantee delivery of a packet. Browsing is hard to diagnose if you don't already know all the other services are running. </p><P CLASS="para"> 862Browsing is purely optional: it's just a way to find the servers on your net and the shares that they provide. Unix has nothing of the sort and happily does without. Browsing also assumes all your machines are on a local area network (LAN) where broadcasts are allowable.</p><P CLASS="para"> 863First, the browsing mechanism identifies a machine using the unreliable UDP protocol; then it makes a normal (reliable) TCP/IP connection to list the shares the machine provides.</p><DIV CLASS="sect3"> 864<H4 CLASS="sect3"> 865<A CLASS="title" NAME="ch09-96207"> 8669.2.6.1 Testing browsing with smbclient </a></h4><P CLASS="para">We'll start with testing the reliable connection first. From the server, try listing its own shares via <EM CLASS="emphasis"> 867smbclient</em> with a <CODE CLASS="literal"> 868-L</code> option of your server's name. You should get: </p><PRE CLASS="programlisting">server% <CODE CLASS="userinput"><B>smbclient -L server</b></code> 869Added interface ip=192.168.236.86 bcast=192.168.236.255 nmask=255.255.255.0 Server time is Tue Apr 28 09:57:28 1998 Timezone is UTC-4.0 870Password: 871Domain=[EXAMPLE] 872OS=[Unix] 873Server=[Samba 1.9.18] 874Server=[server] 875User=[davecb] 876Workgroup=[EXAMPLE] 877Domain=[EXAMPLE] 878 Sharename Type Comment 879 --------- ---- ------- 880 cdrom Disk CD-ROM 881 cl Printer Color Printer 1 882 davecb Disk Home Directories 883 884 This machine has a browse list: 885 Server Comment 886 --------- ------- 887 SERVER Samba 1.9.18 888 889 This machine has a workgroup list: 890 Workgroup Master 891 --------- ------- 892 EXAMPLE SERVER</pre><UL CLASS="itemizedlist"> 893<LI CLASS="listitem"> 894<P CLASS="para"> 895<A CLASS="listitem" NAME="ch09-pgfId-950922"> 896</a>If you didn't get a Sharename list, the server is not allowing you to browse any shares. This should not be the case if you've tested any of the shares with Windows Explorer or the NET USE command. If you haven't done the <CODE CLASS="literal"> 897smbclient</code> <CODE CLASS="literal"> 898-L</code> <CODE CLASS="literal"> 899localhost</code> <CODE CLASS="literal"> 900-U%</code> test yet (see <A CLASS="xref" HREF="ch09_02.html#ch09-40595"> 901Section 9.2.5.2</a>), do it now. An erroneous guest account can prevent the shares from being seen. Also, check the <I CLASS="filename"> 902smb.conf</i> file to make sure you do not have the option <CODE CLASS="literal"> 903browsable</code> <CODE CLASS="literal"> 904=</code> <CODE CLASS="literal"> 905no</code> anywhere in it: we suggest a minimal <I CLASS="filename"> 906smb.conf</i> file (see <A CLASS="xref" HREF="ch09_02.html#ch09-67928"> 907Section 9.2.5.1, A minimal smb.conf file</a>) for you to steal from. You need to have <CODE CLASS="literal"> 908browseable</code> enabled in order to be able to see at least the <CODE CLASS="literal"> 909[temp]</code> share.</p></li><LI CLASS="listitem"> 910<P CLASS="para"> 911<A CLASS="listitem" NAME="ch09-pgfId-945728"> 912</a>If you didn't get a browse list, the server is not providing information about the machines on the network. At least one machine on the net must support browse lists. Make sure you have <CODE CLASS="literal"> 913local</code> <CODE CLASS="literal"> 914master</code> <CODE CLASS="literal"> 915=</code> <CODE CLASS="literal"> 916yes</code> in the <I CLASS="filename"> 917smb.conf</i> file if you want Samba be the local master browser.</p></li><LI CLASS="listitem"> 918<P CLASS="para"> 919<A CLASS="listitem" NAME="ch09-pgfId-945730"> 920</a>If you got a browse list but didn't get <EM CLASS="emphasis"> 921/tmp</em>, you probably have a <I CLASS="filename"> 922smb.conf</i> problem. Go back to <A CLASS="xref" HREF="ch09_02.html#ch09-67494"> 923Section 9.2.4.5</a>.</p></li><LI CLASS="listitem"> 924<P CLASS="para"> 925<A CLASS="listitem" NAME="ch09-pgfId-945734"> 926</a>If you didn't get a workgroup list with your workgroup name in it, it is possible that your workgroup is set incorrectly in the <I CLASS="filename"> 927smb.conf</i> file.</p></li><LI CLASS="listitem"> 928<P CLASS="para"> 929<A CLASS="listitem" NAME="ch09-pgfId-945735"> 930</a>If you didn't get a workgroup list at all, ensure that <CODE CLASS="literal"> 931workgroup</code> <CODE CLASS="literal"> 932=EXAMPLE</code> is present in the <I CLASS="filename"> 933smb.conf</i> file.</p></li><LI CLASS="listitem"> 934<P CLASS="para"> 935<A CLASS="listitem" NAME="ch09-pgfId-945736"> 936</a>If you get nothing, try once more with the options <CODE CLASS="literal"> 937-I</code> <CODE CLASS="replaceable"> 938<I> 939ip_address</i></code> <CODE CLASS="literal"> 940-n</code> <CODE CLASS="replaceable"> 941<I> 942netbios_name</i></code> <CODE CLASS="literal"> 943-W</code> <CODE CLASS="replaceable"> 944<I> 945workgroup</i></code> <CODE CLASS="literal"> 946-d3</code> with the NetBIOS and workgroup name in uppercase. (The <CODE CLASS="literal"> 947-d</code> <CODE CLASS="literal"> 9483</code> option sets the log /debugging level to 3.)</p></li></ul><P CLASS="para"> 949If you're still getting nothing, you shouldn't have gotten this far. Double back to at least <A CLASS="xref" HREF="ch09_02.html#ch09-78512"> 950Section 9.2.3.1, Testing TCP with FTP </a>, or perhaps <A CLASS="xref" HREF="ch09_02.html#ch09-84079"> 951Section 9.2.2.4</a>. On the other hand:</p><UL CLASS="itemizedlist"> 952<LI CLASS="listitem"> 953<P CLASS="para"> 954<A CLASS="listitem" NAME="ch09-pgfId-945746"> 955</a>If you get "SMBtconX failed. ERRSRV - ERRaccess," you aren't permitted access to the server. This normally means you have a <CODE CLASS="literal"> 956valid</code> <CODE CLASS="literal"> 957hosts</code> option that doesn't include the server, or an invalid hosts option that does.</p></li><LI CLASS="listitem"> 958<P CLASS="para"> 959<A CLASS="listitem" NAME="ch09-pgfId-945748"> 960</a> If you get "Bad password," then you presumably have one of the following:</p><UL CLASS="itemizedlist"> 961<LI CLASS="listitem"> 962<P CLASS="para"> 963<A CLASS="listitem" NAME="ch09-pgfId-945749"> 964</a> An incorrect <CODE CLASS="literal"> 965hosts</code> <CODE CLASS="literal"> 966allow</code> or <CODE CLASS="literal"> 967hosts</code> <CODE CLASS="literal"> 968deny</code> line</p></li><LI CLASS="listitem"> 969<P CLASS="para"> 970<A CLASS="listitem" NAME="ch09-pgfId-945750"> 971</a> An incorrect <CODE CLASS="literal"> 972invalid</code> <CODE CLASS="literal"> 973users</code> or <CODE CLASS="literal"> 974valid</code> <CODE CLASS="literal"> 975users</code> line</p></li><LI CLASS="listitem"> 976<P CLASS="para"> 977<A CLASS="listitem" NAME="ch09-pgfId-945751"> 978</a> A lowercase password and OS/2 or Windows for Workgroups clients</p></li><LI CLASS="listitem"> 979<P CLASS="para"> 980<A CLASS="listitem" NAME="ch09-pgfId-945752"> 981</a> A missing or invalid guest account</p></li></ul></li><LI CLASS="listitem"> 982<P CLASS="para"> 983Check what your guest account is (see <A CLASS="xref" HREF="ch09_02.html#ch09-40595"> 984Section 9.2.5.2</a>) and verify your <I CLASS="filename"> 985smb.conf</i> file with <CODE CLASS="literal"> 986testparm</code> <CODE CLASS="literal"> 987smb.conf</code> <CODE CLASS="replaceable"> 988<I> 989your_hostname your_ip_address</i></code> (see <A CLASS="xref" HREF="ch09_02.html#ch09-67494"> 990Section 9.2.4.5</a>) and change or comment out any <CODE CLASS="literal"> 991hosts</code> <CODE CLASS="literal"> 992allow</code>, <CODE CLASS="literal"> 993hosts</code> <CODE CLASS="literal"> 994deny</code>, <CODE CLASS="literal"> 995valid</code> <CODE CLASS="literal"> 996users</code> or <CODE CLASS="literal"> 997invalid</code> <CODE CLASS="literal"> 998users</code> lines.</p></li><LI CLASS="listitem"> 999<P CLASS="para"> 1000<A CLASS="listitem" NAME="ch09-pgfId-945761"> 1001</a>If you get "Connection refused," the <EM CLASS="emphasis"> 1002smbd</em> server is not running or has crashed. Check that it's up, running, and listening to the network with <EM CLASS="emphasis"> 1003netstat</em>, see step <A CLASS="xref" HREF="ch09_02.html#ch09-67494"> 1004Section 9.2.4.5</a>.</p></li><LI CLASS="listitem"> 1005<P CLASS="para"> 1006<A CLASS="listitem" NAME="ch09-pgfId-952948"> 1007</a>If you get "Get_Hostbyname: Unknown host name," you've made a spelling error, there is a mismatch between Unix and NetBIOS hostname, or there is a name service problem. Start nameservice debugging with <A CLASS="xref" HREF="ch09_02.html#ch09-97081"> 1008Section 9.2.5.4</a>. If this works, suspect a name mismatch and go to step <A CLASS="xref" HREF="ch09_02.html#ch09-35552"> 1009Section 9.2.10, Troubleshooting NetBIOS Names</a>.</p></li><LI CLASS="listitem"> 1010<P CLASS="para"> 1011<A CLASS="listitem" NAME="ch09-pgfId-945777"> 1012</a>If you get "Session request failed," the server refused the connection. This usually indicates an internal error, such as insufficient memory to fork a process.</p></li><LI CLASS="listitem"> 1013<P CLASS="para"> 1014<A CLASS="listitem" NAME="ch09-pgfId-945778"> 1015</a>If you get "Your server software is being unfriendly," the initial session request packet received a garbage response from the server. The server may have crashed or started improperly. Go back to <A CLASS="xref" HREF="ch09_02.html#ch09-40595"> 1016Section 9.2.5.2</a>, where the problem is first analyzed.</p></li><LI CLASS="listitem"> 1017<P CLASS="para"> 1018<A CLASS="listitem" NAME="ch09-pgfId-945785"> 1019</a>If you suspect the server is not running, go back to <A CLASS="xref" HREF="ch09_02.html#ch09-49239"> 1020Section 9.2.4.2, Looking for daemon processes with ps</a> to see why the server daemon isn't responding.</p></li></ul></div><DIV CLASS="sect3"> 1021<H4 CLASS="sect3"> 1022<A CLASS="title" NAME="ch09-12446">9.2.6.2 Testing the server with nmblookup</a></h4><P CLASS="para"> 1023This will test the "advertising" system used for Windows name services and browsing. Advertising works by broadcasting one's presence or willingness to provide services. It is the part of browsing that uses an unreliable protocol (UDP), and works only on broadcast networks like Ethernets. The <EM CLASS="emphasis"> 1024nmblookup</em> program broadcasts name queries for the hostname you provide, and returns its IP address and the name of the machine, much like <EM CLASS="emphasis"> 1025nslookup</em> does with DNS. Here, the <CODE CLASS="literal"> 1026-d</code> (debug- or log-level) option, and the <CODE CLASS="literal"> 1027-B</code> (broadcast address) options direct queries to specific machines.</p><P CLASS="para"> 1028First, we check the server from itself. Run <EM CLASS="emphasis"> 1029nmblookup</em> with a <CODE CLASS="literal"> 1030-B</code> option of your server's name to tell it to send the query to the Samba server, and a parameter of <CODE CLASS="literal"> 1031__SAMBA__</code> as the symbolic name to look up. You should get: </p><PRE CLASS="programlisting">server% <B CLASS="emphasis.bold">nmblookup -B </b><CODE CLASS="replaceable"><I>server</i></code> <B CLASS="emphasis.bold">__SAMBA__ </b> 1032Added interface ip=192.168.236.86 bcast=192.168.236.255 nmask=255.255.255.0 1033Sending queries to 192.168.236.86 192.168.236.86 __SAMBA__ </pre><P CLASS="para"> 1034You should get the IP address of the server, followed by the name <CODE CLASS="literal"> 1035__SAMBA__ </code>, which means that the server has successfully advertised that it has a service called <CODE CLASS="literal"> 1036__SAMBA__ </code>, and therefore at least part of NetBIOS nameservice works.</p><UL CLASS="itemizedlist"> 1037<LI CLASS="listitem"> 1038<P CLASS="para"> 1039<A CLASS="listitem" NAME="ch09-pgfId-945802"> 1040</a>If you get "Name_query failed to find name __SAMBA__" you may have specified the wrong address to the <CODE CLASS="literal"> 1041-B</code> option, or <EM CLASS="emphasis"> 1042nmbd</em> is not running. The <CODE CLASS="literal"> 1043-B</code> option actually takes a broadcast address: we're using a machine-name to get a unicast address, and to ask server if it has claimed <CODE CLASS="literal"> 1044__SAMBA__</code>.</p></li><LI CLASS="listitem"> 1045<P CLASS="para"> 1046<A CLASS="listitem" NAME="ch09-pgfId-947471"> 1047</a>Try again with <CODE CLASS="literal"> 1048-B</code><CODE CLASS="replaceable"> 1049<I> 1050 ip_address</i></code>, and if that fails too, <EM CLASS="emphasis"> 1051nmbd</em> isn't claiming the name. Go back briefly to "Testing daemons with testparm" to see if <EM CLASS="emphasis"> 1052nmbd</em> is running. If so, it may not claiming names; this means that Samba is not providing the browsing service - a configuratiuon problem. If that is the case, make sure that <I CLASS="filename"> 1053smb.conf</i> doesn't contain the option <CODE CLASS="literal"> 1054browsing</code> <CODE CLASS="literal"> 1055=</code> <CODE CLASS="literal"> 1056no</code>.</p></li></ul></div><DIV CLASS="sect3"> 1057<H4 CLASS="sect3"> 1058<A CLASS="title" NAME="ch09-32122"> 10599.2.6.3 Testing the client with nmblookup</a></h4><P CLASS="para"> 1060Next, check the IP address of the client from the server with <EM CLASS="emphasis"> 1061nmblookup</em> using <CODE CLASS="literal"> 1062-B</code> option for the client's name and a parameter of <CODE CLASS="literal"> 1063'*'</code> meaning "anything," as shown here: </p><PRE CLASS="programlisting">server% <B CLASS="emphasis.bold">nmblookup -B client '*'</b> 1064Sending queries to 192.168.236.10 192.168.236.10 * 1065Got a positive name query response from 192.168.236.10 (192.168.236.10)</pre><UL CLASS="itemizedlist"> 1066<LI CLASS="listitem"> 1067<P CLASS="para"> 1068<A CLASS="listitem" NAME="ch09-pgfId-945817"> 1069</a>If you receive "Name-query failed to find name *," you have made a spelling mistake, or the client software on the PC isn't installed, started, or bound to TCP/IP. Double back to <a href="ch02_01.html"><b>Chapter 2</b></a> or <a href="ch03_01.html"><b>Chapter 3</b></a> and ensure you have a client installed and listening to the network. </p></li></ul><P CLASS="para"> 1070Repeat the command with the following options if you had any failures:</p><UL CLASS="itemizedlist"> 1071<LI CLASS="listitem"> 1072<P CLASS="para"> 1073<A CLASS="listitem" NAME="ch09-pgfId-945824"> 1074</a>If <CODE CLASS="literal"> 1075nmblookup</code> <CODE CLASS="literal"> 1076-B</code> <CODE CLASS="replaceable"> 1077<I> 1078client_IP_address</i></code> succeeds but <CODE CLASS="literal"> 1079-B</code> <CODE CLASS="replaceable"> 1080<I> 1081client_name</i></code> fails, there is a name service problem with the client's name; go to <A CLASS="xref" HREF="ch09_02.html#ch09-23768"> 1082Section 9.2.8</a>.</p></li><LI CLASS="listitem"> 1083<P CLASS="para"> 1084<A CLASS="listitem" NAME="ch09-pgfId-945825"> 1085</a>If <CODE CLASS="literal"> 1086nmblookup</code> <CODE CLASS="literal"> 1087-B</code> <CODE CLASS="literal"> 1088127.0.0.1'*'</code> succeeds, but <CODE CLASS="literal"> 1089-B</code> <CODE CLASS="replaceable"> 1090<I> 1091client_IP_address</i></code> fails, there is a hardware problem and ping should have failed. See your network manager. </p></li></ul></div><DIV CLASS="sect3"> 1092<H4 CLASS="sect3"> 1093<A CLASS="title" NAME="ch09-98123"> 10949.2.6.4 Testing the network with nmblookup</a></h4><P CLASS="para"> 1095Run the command <EM CLASS="emphasis"> 1096nmblookup</em> again with a <CODE CLASS="literal"> 1097-d</code> option (debug level) of 2 and a parameter of <CODE CLASS="literal"> 1098'*'</code> again. This time we are testing the ability of programs (such as <EM CLASS="emphasis"> 1099nmbd </em>) to use broadcast. It's essentially a connectivity test, done via a broadcast to the default broadcast address. </p><P CLASS="para"> 1100A number of NetBIOS/TCP-IP hosts on the network should respond with "got a positive name query response" messages. Samba may not catch all of the responses in the short time it listens, so you won't always see all the SMB clients on the network. However, you should see most of them:</p><PRE CLASS="programlisting">server% <B CLASS="emphasis.bold">nmblookup -d 2 '*' </b> 1101Added interface ip=192.168.236.86 bcast=192.168.236.255 nmask=255.255.255.0 Sending queries to 192.168.236.255 1102Got a positive name query response from 192.168.236.191 (192.168.236.191) 1103Got a positive name query response from 192.168.236.228 (192.168.236.228) 1104Got a positive name query response from 192.168.236.75 (192.168.236.75) 1105Got a positive name query response from 192.168.236.79 (192.168.236.79) 1106Got a positive name query response from 192.168.236.206 (192.168.236.206) 1107Got a positive name query response from 192.168.236.207 (192.168.236.207) 1108Got a positive name query response from 192.168.236.217 (192.168.236.217) 1109Got a positive name query response from 192.168.236.72 (192.168.236.72) 192.168.236.86 * </pre><P CLASS="para"> 1110However:</p><UL CLASS="itemizedlist"> 1111<LI CLASS="listitem"> 1112<P CLASS="para"> 1113<A CLASS="listitem" NAME="ch09-pgfId-945841"> 1114</a>If this doesn't give at least the client address you previously tested, the default broadcast address is wrong. Try <CODE CLASS="literal"> 1115nmblookup</code> <CODE CLASS="literal"> 1116-B</code> <CODE CLASS="literal"> 1117255.255.255.255</code> <CODE CLASS="literal"> 1118-d</code> <CODE CLASS="literal"> 11192</code> <CODE CLASS="literal"> 1120'*'</code>, which is a last-ditch variant (a broadcast address of all ones). If this draws responses, the broadcast address you've been using before is wrong. Troubleshooting these is discussed in the <A CLASS="xref" HREF="ch09_02.html#ch09-45060"> 1121Section 9.2.9.2, Broadcast addresses</a> section, later in this chapter.</p></li><LI CLASS="listitem"> 1122<P CLASS="para"> 1123<A CLASS="listitem" NAME="ch09-pgfId-951306"> 1124</a>If the address 255.255.255.255 fails too, check your notes to see if your PC and server are on different subnets, as discovered in <A CLASS="xref" HREF="ch09_02.html#ch09-84079"> 1125Section 9.2.2.4</a>. You should try to diagnose this with a server and client on the same subnet, but if you can't, you can try specifying the remote subnet's broadcast address with <CODE CLASS="literal"> 1126-B</code>. Finding that address is discussed in the same place as troubleshooting broadcast addresses, in the section <A CLASS="xref" HREF="ch09_02.html#ch09-45060"> 1127Section 9.2.9.2</a>, later in this chapter. The <CODE CLASS="literal"> 1128-B</code> option will work if your router supports directed broadcasts; if it doesn't, you may be forced to test with a client on the same network.</p></li></ul></div><DIV CLASS="sect3"> 1129<H4 CLASS="sect3"> 1130<A CLASS="title" NAME="ch09-pgfId-947520"> 11319.2.6.5 Testing client browsing with net view</a></h4><P CLASS="para">On the client, run the command <CODE CLASS="replaceable"><I>net view \\server</i></code> in a DOS window to see if you can connect to the client and ask what shares it provides. You should get back a list of available shares on the server, as shown in <A CLASS="xref" HREF="ch09_02.html#ch09-83710"> 1132Figure 9.4</a>. </p><H4 CLASS="figure"> 1133<A CLASS="title" NAME="ch09-83710"> 1134Figure 9.4: Using the net view command</a></h4><IMG CLASS="graphic" SRC="figs/sam.0904.gif" ALT="Figure 9.4"><P CLASS="para"> 1135If you received this, continue with the section <A CLASS="xref" HREF="ch09_02.html#ch09-21713"> 1136Section 9.2.7, Other Things that Fail</a>.</p><UL CLASS="itemizedlist"> 1137<LI CLASS="listitem"> 1138<P CLASS="para"> 1139<A CLASS="listitem" NAME="ch09-pgfId-953009"> 1140</a>If you get "Network name not found" for the name you just tested in the section <A CLASS="xref" HREF="ch09_02.html#ch09-32122"> 1141Section 9.2.6.3, Testing the client with nmblookup</a>, there is a problem with the client software itself. Double-check this by running <EM CLASS="emphasis"> 1142nmblookup</em> on the client; if it works and NET VIEW doesn't, the client is at fault.</p></li><LI CLASS="listitem"> 1143<P CLASS="para"> 1144<A CLASS="listitem" NAME="ch09-pgfId-945868"> 1145</a>Of course, if <EM CLASS="emphasis"> 1146nmblookup</em> fails, there is a NetBIOS nameservice problem, as discussed in the section <A CLASS="xref" HREF="ch09_02.html#ch09-35552"> 1147Section 9.2.10</a>.</p></li><LI CLASS="listitem"> 1148<P CLASS="para"> 1149<A CLASS="listitem" NAME="ch09-pgfId-945874"> 1150</a>If you get "You do not have the necessary access rights," or "This server is not configured to list shared resources," either your guest account is misconfigured (see <A CLASS="xref" HREF="ch09_02.html#ch09-40595"> 1151Section 9.2.5.2</a>), or you have a <CODE CLASS="literal"> 1152hosts</code> <CODE CLASS="literal"> 1153allow</code> or <CODE CLASS="literal"> 1154hosts</code> <CODE CLASS="literal"> 1155deny</code> line that prohibits connections from your machine. These problems should have been detected by the <EM CLASS="emphasis"> 1156smbclient</em> tests starting in the section <A CLASS="xref" HREF="ch09_02.html#ch09-96207"> 1157Section 9.2.6.1, Testing browsing with smbclient </a>.</p></li><LI CLASS="listitem"> 1158<P CLASS="para"> 1159<A CLASS="listitem" NAME="ch09-pgfId-945882"> 1160</a>If you get "The specified computer is not receiving requests," you have misspelled the name, the machine is unreachable by broadcast (tested in "Testing the network with nmblookup"), or it's not running <EM CLASS="emphasis"> 1161nmbd</em>.</p></li><LI CLASS="listitem"> 1162<P CLASS="para"> 1163<A CLASS="listitem" NAME="ch09-pgfId-954090"> 1164</a>If you get "Bad password error," you're probably encountering the Microsoft-encrypted password problem, as discussed in <a href="ch06_01.html"><b>Chapter 6</b></a>, with its corrections.</p></li></ul></div><DIV CLASS="sect3"> 1165<H4 CLASS="sect3"> 1166<A CLASS="title" NAME="ch09-pgfId-954094"> 11679.2.6.6 Browsing the server from the client</a></h4><P CLASS="para">From the Network Neighborhood (File Manager in older releases), try to browse the server. Your Samba server should appear in the browse list of your local workgroup. You should be able to double click on the name of the server and get a list of shares, as illustrated in <A CLASS="xref" HREF="ch09_02.html#ch09-60004"> 1168Figure 9.5</a>. </p><H4 CLASS="figure"> 1169<A CLASS="title" NAME="ch09-60004"> 1170Figure 9.5: List of shares on a server</a></h4><IMG CLASS="graphic" SRC="figs/sam.0905.gif" ALT="Figure 9.5"><UL CLASS="itemizedlist"> 1171<LI CLASS="listitem"> 1172<P CLASS="para"> 1173<A CLASS="listitem" NAME="ch09-pgfId-945897"> 1174</a>If you get an "Invalid password" error with NT 4.0, NT 3.5 with Patch 3, Windows 95 with Patch 3, Windows 98 or any of these with Internet Explorer 4.0, it's most likely the encryption problem again. All of these clients default to using Microsoft encryption for passwords (see <a href="ch06_01.html"><b>Chapter 6</b></a>).</p></li><LI CLASS="listitem"> 1175<P CLASS="para"> 1176<A CLASS="listitem" NAME="ch09-pgfId-945903"> 1177</a>If you receive an "Unable to browse the network" error, one of the following has ocurred:</p><UL CLASS="itemizedlist"> 1178<LI CLASS="listitem"> 1179<P CLASS="para"> 1180<A CLASS="listitem" NAME="ch09-pgfId-945904"> 1181</a>You have looked too soon, before the broadcasts and updates have completed; try waiting 30 seconds before re-attempting.</p></li><LI CLASS="listitem"> 1182<P CLASS="para"> 1183<A CLASS="listitem" NAME="ch09-pgfId-945905"> 1184</a>There is a network problem you've not yet diagnosed.</p></li><LI CLASS="listitem"> 1185<P CLASS="para"> 1186<A CLASS="listitem" NAME="ch09-pgfId-945906"> 1187</a>There is no browse master. Add the configuration option <CODE CLASS="literal"> 1188local</code> <CODE CLASS="literal"> 1189master</code> <CODE CLASS="literal"> 1190=</code> <CODE CLASS="literal"> 1191yes</code> to your <EM CLASS="emphasis"> 1192smb.conf</em> file.</p></li><LI CLASS="listitem"> 1193<P CLASS="para"> 1194<A CLASS="listitem" NAME="ch09-pgfId-945907"> 1195</a>No shares are marked <CODE CLASS="literal"> 1196browsable</code> in the <EM CLASS="emphasis"> 1197smb.conf</em> file.</p></li></ul></li><LI CLASS="listitem"> 1198<P CLASS="para"> 1199<A CLASS="listitem" NAME="ch09-pgfId-945909"> 1200</a>If you receive the message "\\server is not accessible," then:</p><UL CLASS="itemizedlist"> 1201<LI CLASS="listitem"> 1202<P CLASS="para"> 1203<A CLASS="listitem" NAME="ch09-pgfId-945910"> 1204</a> You have the encrypted password problem</p></li><LI CLASS="listitem"> 1205<P CLASS="para"> 1206<A CLASS="listitem" NAME="ch09-pgfId-945911"> 1207</a> The machine really isn't accessible </p></li><LI CLASS="listitem"> 1208<P CLASS="para"> 1209<A CLASS="listitem" NAME="ch09-pgfId-945912"> 1210</a> The machine doesn't support browsing</p></li></ul></li></ul></div></div><DIV CLASS="sect2"> 1211<H3 CLASS="sect2"> 1212<A CLASS="title" NAME="ch09-21713">9.2.7 Other Things that Fail </a></h3><P CLASS="para"> 1213If you've made it here, either the problem is solved or it's not one we've seen. The next sections cover troubleshooting tasks that are required to have the infrastructure to run Samba, not Samba itself.</p><DIV CLASS="sect3"> 1214<H4 CLASS="sect3"> 1215<A CLASS="title" NAME="ch09-pgfId-945916"> 12169.2.7.1 Not logging on</a></h4><P CLASS="para">An occasional problem is forgetting to log in to the client or logging in as a wrong (account-less) person. The former is not diagnosed at all: Windows tries to be friendly and lets you on. Locally! The only warning of the latter is that Windows welcomes you and asks about your new account. Either of these leads to repeated refusals to connect and endless requests for passwords. If nothing else seems to work, try logging out or shutting down and logging in again.</p></div></div><DIV CLASS="sect2"> 1217<H3 CLASS="sect2"> 1218<A CLASS="title" NAME="ch09-23768"> 12199.2.8 Troubleshooting Name Services</a></h3><P CLASS="para">This section looks at simple troubleshooting of all the name services that you will encounter, but only for the common problems that affect Samba.</p><P CLASS="para"> 1220There are several good references for troubleshooting particular name services: Paul Albitz and Cricket Liu's <EM CLASS="emphasis"> 1221DNS and Bind</em> covers the Domain Name Service (DNS), Hal Stern's <EM CLASS="emphasis"> 1222NFS and NIS</em> (both from O'Reilly) covers NIS ("Yellow pages") while WINS (Windows Internet Name Service), <I CLASS="filename"> 1223hosts/LMHOSTS</i> files and NIS+ are best covered by their respective vendor's manuals.</p><P CLASS="para"> 1224The problems addressed in this section are:</p><UL CLASS="itemizedlist"> 1225<LI CLASS="listitem"> 1226<P CLASS="para"> 1227<A CLASS="listitem" NAME="ch09-pgfId-945926"> 1228</a>Identifying name services</p></li><LI CLASS="listitem"> 1229<P CLASS="para"> 1230<A CLASS="listitem" NAME="ch09-pgfId-945927"> 1231</a>A hostname can't be looked up</p></li><LI CLASS="listitem"> 1232<P CLASS="para"> 1233<A CLASS="listitem" NAME="ch09-pgfId-945928"> 1234</a>The long (FQDN) form of a hostname works but the short form doesn't </p></li><LI CLASS="listitem"> 1235<P CLASS="para"> 1236<A CLASS="listitem" NAME="ch09-pgfId-945929"> 1237</a>The short form of the name works, but the long form doesn't</p></li><LI CLASS="listitem"> 1238<P CLASS="para"> 1239<A CLASS="listitem" NAME="ch09-pgfId-945930"> 1240</a>A long delay ocurrs before the expected result </p></li></ul><DIV CLASS="sect3"> 1241<H4 CLASS="sect3"> 1242<A CLASS="title" NAME="ch09-pgfId-945931"> 12439.2.8.1 Identifying what's in use</a></h4><P CLASS="para">First, see if both the server and the client are using DNS, WINS, NIS, or <I CLASS="filename"> 1244hosts</i> files to look up IP addresses when you give them a name. Each kind of machine will have a different preference: </p><UL CLASS="itemizedlist"> 1245<LI CLASS="listitem"> 1246<P CLASS="para"> 1247<A CLASS="listitem" NAME="ch09-pgfId-945934"> 1248</a>Windows 95 and 98 machines will look in WINS and <I CLASS="filename"> 1249LMHOSTS</i> files first, then broadcast, and finally try DNS and <I CLASS="filename"> 1250hosts</i> files.</p></li><LI CLASS="listitem"> 1251<P CLASS="para"> 1252<A CLASS="listitem" NAME="ch09-pgfId-945935"> 1253</a>NT will look in WINS, then broadcast, LMHOSTS files, and finally <I CLASS="filename"> 1254hosts</i> and DNS.</p></li><LI CLASS="listitem"> 1255<P CLASS="para"> 1256<A CLASS="listitem" NAME="ch09-pgfId-945936"> 1257</a>Windows programs using the WINSOCK standard (like PC-NFSs) will use hosts files, DNS, WINS, and then broadcast. Don't assume that if a different program's name service works, the SMB client program's name service will!</p></li><LI CLASS="listitem"> 1258<P CLASS="para"> 1259<A CLASS="listitem" NAME="ch09-pgfId-945937"> 1260</a>Samba daemons will use <I CLASS="filename"> 1261LMHOSTS</i>, WINS, the Unix host's preference, and then broadcast.</p></li><LI CLASS="listitem"> 1262<P CLASS="para"> 1263<A CLASS="listitem" NAME="ch09-pgfId-945938"> 1264</a>Unix hosts can be configured to use any combination of DNS, <I CLASS="filename"> 1265hosts</i> files, and NIS and NIS+, generally in any order.</p></li></ul><P CLASS="para"> 1266We recommend that the client machines be configured to use WINS and DNS, the Samba daemons to use WINS and DNS, and the Unix server to use DNS. You'll have to look at your notes and the actual machines to see which is in use.</p><P CLASS="para"> 1267On the clients, the name services are all set in the TCP/IP Properties panel of the Networking Control Panel, as discussed in <a href="ch03_01.html"><b>Chapter 3</b></a>. You may need to check there to see what you've actually turned on. On the server, see if an <I CLASS="filename"> 1268/etc/resolv.conf</i> file exists. If it does, you're using DNS. You may be using the others as well, though. You'll need to check for NIS and combinations of services.</p><P CLASS="para"> 1269Check for an <I CLASS="filename"> 1270/etc/nsswitch.conf</i> file on Solaris and other System V Unix operating systems. If you have one, look for a line that begins <CODE CLASS="literal"> 1271host</code>:, followed by one or more of <CODE CLASS="literal"> 1272files</code>, <CODE CLASS="literal"> 1273bind</code>, <CODE CLASS="literal"> 1274nis</code> or <CODE CLASS="literal"> 1275nis+</code>. These are the name services to use, in order, with optional extra material in square brackets. <EM CLASS="emphasis"> 1276files</em> stands for using<EM CLASS="emphasis"> 1277 hosts</em> files, while <EM CLASS="emphasis"> 1278bind</em> (the Berkeley Internet Name Daemon) stands for using DNS.</p><P CLASS="para"> 1279If the client and server differ, the first thing to do is to get them in sync. Clients can only use only DNS, WINS, <EM CLASS="emphasis"> 1280hosts </em>files and <EM CLASS="emphasis"> 1281lmhosts</em> files, not NIS or NIS+. Servers can use <EM CLASS="emphasis"> 1282hosts</em> files, DNS, and NIS or NIS+, but not WINS - even if your Samba server provides WINS services. If you can't get all the systems to use the same services, you'll have to carefully check the server and the client for the same data.</p><P CLASS="para"> 1283Samba 2.0 (and late 1.9 versions) added a <CODE CLASS="literal"> 1284-R</code><I CLASS="option"> 1285 </i>(resolve order) option to <EM CLASS="emphasis"> 1286smbclient</em>. If you want to troubleshoot WINS, for example, you'd say:</p><PRE CLASS="programlisting"> smbclient -L <CODE CLASS="replaceable"><I>server</i></code> -R wins</pre><P CLASS="para"> 1287The possible settings are <CODE CLASS="literal"> 1288hosts</code> (which means whatever the Unix machine is using, not just<I CLASS="filename"> 1289 /etc/hosts</i> files), <CODE CLASS="literal"> 1290lmhosts</code>, <CODE CLASS="literal"> 1291wins</code> and <CODE CLASS="literal"> 1292bcast</code> (broadcast).</p><P CLASS="para"> 1293In the following sections, we use the term <EM CLASS="emphasis"> 1294long name</em> for a fully-qualified domain name (FQDN), like <CODE CLASS="literal"> 1295server.example.com</code>, and the term <EM CLASS="emphasis"> 1296short name</em> for the host part of a FQDN, like <CODE CLASS="literal"> 1297server</code>.</p></div><DIV CLASS="sect3"> 1298<H4 CLASS="sect3"> 1299<A CLASS="title" NAME="ch09-pgfId-947590"> 13009.2.8.2 Cannot look up hostnames</a></h4><P CLASS="para"> 1301 Try the following:</p><UL CLASS="itemizedlist"> 1302<LI CLASS="listitem"> 1303<P CLASS="para"> 1304<A CLASS="listitem" NAME="ch09-pgfId-945950"> 1305</a>In DNS:</p><P CLASS="para"> 1306Run <CODE CLASS="literal"> 1307nslookup</code> <CODE CLASS="replaceable"> 1308<I> 1309name</i></code>. If this fails, look for a <I CLASS="filename"> 1310resolv.conf</i> error, a downed DNS server, or a short/long name problem (see the next section). Try the following:</p></li><LI CLASS="listitem"> 1311<P CLASS="para"> 1312<A CLASS="listitem" NAME="ch09-pgfId-945952"> 1313</a>Your <I CLASS="filename"> 1314/etc/resolv.conf</i> should contain one or more name-server lines, each with an IP address. These are the addresses of your DNS servers.</p></li><LI CLASS="listitem"> 1315<P CLASS="para"> 1316<A CLASS="listitem" NAME="ch09-pgfId-947597"> 1317</a>ping each of the server addresses you find. If this fails for one, suspect the machine. If it fails for each, suspect your network.</p></li><LI CLASS="listitem"> 1318<P CLASS="para"> 1319<A CLASS="listitem" NAME="ch09-pgfId-947600"> 1320</a>Retry the lookup using the full domain name (e.g., <EM CLASS="emphasis"> 1321server.example.com</em>) if you tried the short name first, or the short name if you tried the long name first. If results differ, skip to the next section. </p></li></ul><UL CLASS="itemizedlist"> 1322<LI CLASS="listitem"> 1323<P CLASS="para"> 1324<A CLASS="listitem" NAME="ch09-pgfId-945958"> 1325</a>In Broadcast/ WINS:</p><P CLASS="para"> 1326Broadcast/ WINS does only short names such as <CODE CLASS="literal"> 1327server</code>, (not long ones, such as <CODE CLASS="literal"> 1328server.example.com)</code>. Run <CODE CLASS="literal"> 1329nmblookup</code> <CODE CLASS="literal"> 1330-S</code> <CODE CLASS="replaceable"> 1331<I> 1332server</i></code>.<CODE CLASS="replaceable"> 1333<I> 1334 </i></code>This reports everything broadcast has registered for the name. In our example, it looks like this:</p></li></ul><PRE CLASS="programlisting"> 1335Looking up status of 192.168.236.86 1336received 10 names 1337 SERVER <00> - M <ACTIVE> 1338 SERVER <03> - M <ACTIVE> 1339 SERVER <1f> - M <ACTIVE> 1340 SERVER <20> - M <ACTIVE> 1341 ..__MSBROWSE__. <01> - <GROUP> M <ACTIVE> 1342 MYGROUP <00> - <GROUP> M <ACTIVE> 1343 MYGROUP <1b> - M <ACTIVE> 1344 MYGROUP <1c> - <GROUP> M <ACTIVE> 1345 MYGROUP <1d> - M <ACTIVE> 1346 MYGROUP <1e> - <GROUP> M <ACTIVE></pre><UL CLASS="itemizedlist"> 1347<LI CLASS="listitem"> 1348<P CLASS="para"> 1349The required entry is <CODE CLASS="literal"> 1350SERVER</code> <CODE CLASS="literal"> 1351<00></code>, which identifies <CODE CLASS="replaceable"> 1352<I> 1353server</i></code> as being this machine's NetBIOS name. You should also see your workgroup mentioned one or more times. If these lines are missing, Broadcast/WINS cannot look up names and will need attention.</p></li></ul><P CLASS="para"> 1354The numbers in angle brackets in the previous output identify NetBIOS names as being workgroups, workstations, and file users of the messenger service, master browsers, domain master browsers, domain controllers and a plethora of others. We primarily use <CODE CLASS="literal"> 1355<00></code> to identify machine and workgroup names and <CODE CLASS="literal"> 1356<20></code> to identify machines as servers. The complete list is available at <A CLASS="systemitem.url" HREF="http://support.microsoft.com/support/kb/articles/q163/4/09.asp"> 1357http://support.microsoft.com/support/kb/articles/q163/4/09.asp</a>.</p><UL CLASS="itemizedlist"> 1358<LI CLASS="listitem"> 1359<P CLASS="para"> 1360<A CLASS="listitem" NAME="ch09-pgfId-945982"> 1361</a>In NIS:</p><P CLASS="para"> 1362Try <CODE CLASS="literal"> 1363ypmatch</code> <CODE CLASS="literal"> 1364name</code> <CODE CLASS="literal"> 1365hosts</code>. If this fails, NIS is down. Find out the NIS server's name by running<EM CLASS="emphasis"> 1366 ypwhich</em>, and ping the machine it to see if it's accessible.</p></li><LI CLASS="listitem"> 1367<P CLASS="para"> 1368<A CLASS="listitem" NAME="ch09-pgfId-945985"> 1369</a>In NIS+:</p><P CLASS="para"> 1370If you're running NIS+, try <CODE CLASS="literal"> 1371nismatch</code> <CODE CLASS="literal"> 1372name</code> <CODE CLASS="literal"> 1373hosts</code>. If this fails, NIS is down. Find out the NIS server's name by running <EM CLASS="emphasis"> 1374niswhich</em>, and ping that machine to see if it's accessible.</p></li><LI CLASS="listitem"> 1375<P CLASS="para"> 1376<A CLASS="listitem" NAME="ch09-pgfId-945988"> 1377</a>In <I CLASS="filename"> 1378hosts</i> files:</p><P CLASS="para"> 1379Inspect <I CLASS="filename"> 1380/etc/hosts</i> on the client (<CODE CLASS="literal">C:\WINDOWS\HOSTS</code>). Each line should have an IP number and one or more names, the primary name first, then any optional aliases. An example follows:</p></li></ul><PRE CLASS="programlisting"> 1381 127.0.0.1 localhost 1382 192.168.236.1 dns.svc.example.com 1383 192.168.236.10 client.example.com client 1384 192.168.236.11 backup.example.com loghost 1385 192.168.236.86 server.example.com server 1386 192.168.236.254 router.svc.example.com </pre><UL CLASS="itemizedlist"> 1387<LI CLASS="listitem"> 1388<P CLASS="para"> 1389On Unix, <CODE CLASS="literal"> 1390localhost</code> should always be 127.0.0.1, although it may be just an alias for a hostname on the PC. On the client, check that there are no <CODE CLASS="literal"> 1391#XXX</code> directives at the ends of the lines; these are LAN Manager/NetBIOS directives, and should appear only in <EM CLASS="emphasis"> 1392LMHOSTS</em> files (<CODE CLASS="literal">C:\WINDOWS\LMHOSTS</code>). </p></li><LI CLASS="listitem"> 1393<P CLASS="para"> 1394<A CLASS="listitem" NAME="ch09-pgfId-946000"> 1395</a>In <EM CLASS="emphasis"> 1396LMHOSTS</em> files:</p><P CLASS="para"> 1397This file is a local source for LAN Manager (NetBIOS) names. It has a format very similar to <I CLASS="filename"> 1398/etc/hosts</i> files, but does not support long-form domain names (e.g., <CODE CLASS="literal"> 1399server.example.com</code>), and may have a number of optional <CODE CLASS="literal"> 1400#XXX</code> directives following the names. Note there usually is a <EM CLASS="emphasis"> 1401lmhosts.sam</em> (for sample) file in <CODE CLASS="literal"> 1402C:\WINDOWS</code>, but it's not used unless renamed to <CODE CLASS="literal"> 1403C:\WINDOWS\LMHOSTS</code>.</p></li></ul></div><DIV CLASS="sect3"> 1404<H4 CLASS="sect3"> 1405<A CLASS="title" NAME="ch09-pgfId-946005"> 14069.2.8.3 Long and short hostnames</a></h4><P CLASS="para">Where the long (FQDN) form of a hostname works but the short name doesn't (for example, <CODE CLASS="literal"> 1407client.example.com</code> works but <CODE CLASS="literal"> 1408client</code> doesn't), consider the following:</p><UL CLASS="itemizedlist"> 1409<LI CLASS="listitem"> 1410<P CLASS="para"> 1411<A CLASS="listitem" NAME="ch09-pgfId-946007"> 1412</a>DNS: </p><P CLASS="para"> 1413This usually indicates there is no default domain in which to look up the short names. Look for a <CODE CLASS="literal"> 1414default</code> line in <I CLASS="filename"> 1415/etc/resolv.conf</i> on the Samba server with your domain in it, or a <CODE CLASS="literal"> 1416search</code> line with one or more domains in it. One or the other may need to be present to make short names usable; which one depends on vendor and version of the DNS resolver. Try adding <CODE CLASS="literal"> 1417domain</code> <CODE CLASS="replaceable"> 1418<I> 1419your domain</i></code> to <I CLASS="filename"> 1420resolv.conf</i> and ask your network or DNS administrator what should have been in the file.</p></li><LI CLASS="listitem"> 1421<P CLASS="para"> 1422<A CLASS="listitem" NAME="ch09-pgfId-946010"> 1423</a>Broadcast/WINS: </p><P CLASS="para"> 1424Broadcast/WINS doesn't support long names; it won't suffer from this problem. </p></li><LI CLASS="listitem"> 1425<P CLASS="para"> 1426<A CLASS="listitem" NAME="ch09-pgfId-946012"> 1427</a>NIS: </p><P CLASS="para"> 1428Try the command <CODE CLASS="literal"> 1429ypmatch</code> <CODE CLASS="literal"> 1430hostname</code> <CODE CLASS="literal"> 1431hosts</code>. If you don't get a match, your tables don't include short names. Speak to your network manager; short names may be missing by accident, or may be unsupported as a matter of policy. Some sites don't ever use (ambiguous) short names.</p></li><LI CLASS="listitem"> 1432<P CLASS="para"> 1433<A CLASS="listitem" NAME="ch09-pgfId-946014"> 1434</a>NIS+ :</p><P CLASS="para"> 1435Try <CODE CLASS="literal"> 1436nismatch</code> <CODE CLASS="replaceable"> 1437<I> 1438hostname</i></code> <CODE CLASS="literal"> 1439hosts</code>, and treat failure exactly as with NIS above.</p></li><LI CLASS="listitem"> 1440<P CLASS="para"> 1441<A CLASS="listitem" NAME="ch09-pgfId-946016"> 1442</a><EM CLASS="emphasis"> 1443hosts:</em> </p><P CLASS="para"> 1444If the short name is not in <I CLASS="filename"> 1445/etc/hosts</i>, consider adding it as an alias. Avoid, if you can, short names as primary names (the first one on a line). Have them as aliases if your system permits.</p></li><LI CLASS="listitem"> 1446<P CLASS="para"> 1447<A CLASS="listitem" NAME="ch09-pgfId-946018"> 1448</a><I CLASS="filename"> 1449LMHOSTS</i>: </p><P CLASS="para"> 1450LAN Manager doesn't support long names, so it won't suffer from this problem. </p></li></ul><P CLASS="para"> 1451On the other hand, if the short form of the name works and the long doesn't, consider the following:</p><UL CLASS="itemizedlist"> 1452<LI CLASS="listitem"> 1453<P CLASS="para"> 1454<A CLASS="listitem" NAME="ch09-pgfId-946022"> 1455</a>DNS: </p><P CLASS="para"> 1456This is bizarre; see your network or DNS administrator, as this is probably a DNS setup bug.</p></li><LI CLASS="listitem"> 1457<P CLASS="para"> 1458<A CLASS="listitem" NAME="ch09-pgfId-947697"> 1459</a>Broadcast/WINS: </p><P CLASS="para"> 1460This is a normal bug; Broadcast/WINS can't use the long form. Optionally, consider DNS. Microsoft has stated that they will switch to DNS, though it's not providing name types like <00>.</p></li><LI CLASS="listitem"> 1461<P CLASS="para"> 1462<A CLASS="listitem" NAME="ch09-pgfId-947709"> 1463</a>NIS:</p><P CLASS="para"> 1464If you can use <CODE CLASS="literal"> 1465ypmatch</code> to look up the short form but not the long, consider adding the long form to the table as at least an alias.</p></li><LI CLASS="listitem"> 1466<P CLASS="para"> 1467<A CLASS="listitem" NAME="ch09-pgfId-947718"> 1468</a>NIS+: </p><P CLASS="para"> 1469Same as NIS, except you use <CODE CLASS="literal"> 1470nismatch</code> instead of <CODE CLASS="literal"> 1471ypmatch</code> to look up names.</p></li><LI CLASS="listitem"> 1472<P CLASS="para"> 1473<A CLASS="listitem" NAME="ch09-pgfId-947720"> 1474</a><I CLASS="filename"> 1475hosts:</i></p><P CLASS="para"> 1476Add the long name as at least an alias, and preferably as the primary form. Also consider using DNS if it's practical.</p></li><LI CLASS="listitem"> 1477<P CLASS="para"> 1478<A CLASS="listitem" NAME="ch09-pgfId-947727"> 1479</a><I CLASS="filename"> 1480LMHOSTS</i>: </p><P CLASS="para"> 1481This is a normal bug. LAN Manager can't use the long form; consider switching to DNS or <I CLASS="filename"> 1482hosts</i>.</p></li></ul></div><DIV CLASS="sect3"> 1483<H4 CLASS="sect3"> 1484<A CLASS="title" NAME="ch09-pgfId-946040"> 14859.2.8.4 Unusual delays</a></h4><P CLASS="para">When there is a long delay before the expected result: </p><UL CLASS="itemizedlist"> 1486<LI CLASS="listitem"> 1487<P CLASS="para"> 1488<A CLASS="listitem" NAME="ch09-pgfId-947733"> 1489</a>DNS: </p><P CLASS="para"> 1490Test the same name with the <KBD CLASS="command"> 1491nslookup</kbd> command on the machine (client or server) that is slow. If <KBD CLASS="command"> 1492nslookup</kbd> is also slow, you have a DNS problem. If it's slower on a client, you have too many protocols bound to the Ethernet card. Eliminate NetBEUI, which is infamously slow, and optionally, Novel, assuming you don't need them. This is especially important on Windows 95, which is particularly sensitive to excess protocols.</p></li><LI CLASS="listitem"> 1493<P CLASS="para"> 1494<A CLASS="listitem" NAME="ch09-pgfId-946044"> 1495</a>Broadcast/ WINS:</p><P CLASS="para"> 1496Test the client using <CODE CLASS="literal"> 1497nmblookup</code>, and if it's faster, you probably have the protocols problem as mentioned in the previous item.</p></li><LI CLASS="listitem"> 1498<P CLASS="para"> 1499<A CLASS="listitem" NAME="ch09-pgfId-946047"> 1500</a>NIS:</p><P CLASS="para"> 1501Try <CODE CLASS="literal"> 1502ypmatch</code>, and if it's slow, report the problem to your network manager.</p></li><LI CLASS="listitem"> 1503<P CLASS="para"> 1504<A CLASS="listitem" NAME="ch09-pgfId-946049"> 1505</a>NIS+: </p><P CLASS="para"> 1506Try <CODE CLASS="literal"> 1507nismatch</code>, similarly.</p></li><LI CLASS="listitem"> 1508<P CLASS="para"> 1509<A CLASS="listitem" NAME="ch09-pgfId-946051"> 1510</a><EM CLASS="emphasis"> 1511hosts</em>:</p><P CLASS="para"> 1512<EM CLASS="emphasis"> 1513hosts</em> files, if of reasonable size, are always fast. You probably have the protocols problem mentioned under DNS, above.</p></li><LI CLASS="listitem"> 1514<P CLASS="para"> 1515<A CLASS="listitem" NAME="ch09-pgfId-946053"> 1516</a><EM CLASS="emphasis"> 1517LMHOSTS</em>:</p><P CLASS="para"> 1518This is not a name lookup problem; <EM CLASS="emphasis"> 1519LMHOSTS</em> files are as fast as <EM CLASS="emphasis"> 1520hosts</em> files.</p></li></ul></div><DIV CLASS="sect3"> 1521<H4 CLASS="sect3"> 1522<A CLASS="title" NAME="ch09-pgfId-946055"> 15239.2.8.5 Localhost issues</a></h4><P CLASS="para">When a localhost isn't 127.0.0.1, try the following:</p><UL CLASS="itemizedlist"> 1524<LI CLASS="listitem"> 1525<P CLASS="para"> 1526<A CLASS="listitem" NAME="ch09-pgfId-946056"> 1527</a>DNS:</p><P CLASS="para"> 1528There is probably no record for <CODE CLASS="literal"> 1529localhost.</code> <CODE CLASS="literal"> 1530A</code> <CODE CLASS="literal"> 1531127.0.0.1</code>. Arrange to add one, and a reverse entry, <CODE CLASS="literal"> 15321.0.0.127.IN-ADDR.ARPA</code> <CODE CLASS="literal"> 1533PTR</code> <CODE CLASS="literal"> 1534127.0.0.1</code>.</p></li><LI CLASS="listitem"> 1535<P CLASS="para"> 1536<A CLASS="listitem" NAME="ch09-pgfId-946058"> 1537</a>Broadcast/WINS:</p><P CLASS="para"> 1538Not applicable.</p></li><LI CLASS="listitem"> 1539<P CLASS="para"> 1540<A CLASS="listitem" NAME="ch09-pgfId-946060"> 1541</a>NIS:</p><P CLASS="para"> 1542If <CODE CLASS="literal"> 1543localhost</code> isn't in the table, add it.</p></li><LI CLASS="listitem"> 1544<P CLASS="para"> 1545<A CLASS="listitem" NAME="ch09-pgfId-946062"> 1546</a>NIS+: </p><P CLASS="para"> 1547If <CODE CLASS="literal"> 1548localhost</code> isn't in the table, add it.</p></li><LI CLASS="listitem"> 1549<P CLASS="para"> 1550<A CLASS="listitem" NAME="ch09-pgfId-946064"> 1551</a><I CLASS="filename"> 1552hosts:</i></p><P CLASS="para"> 1553Add a line is the <EM CLASS="emphasis"> 1554hosts</em> file that says <CODE CLASS="literal"> 1555127.0.0.1</code> <CODE CLASS="literal"> 1556localhost</code></p></li><LI CLASS="listitem"> 1557<P CLASS="para"> 1558<A CLASS="listitem" NAME="ch09-pgfId-946066"> 1559</a><I CLASS="filename"> 1560LMHOSTS</i>:</p><P CLASS="para"> 1561Not applicable.</p></li></ul></div></div><DIV CLASS="sect2"> 1562<H3 CLASS="sect2"> 1563<A CLASS="title" NAME="ch09-pgfId-953970">9.2.9 Troubleshooting Network Addresses</a></h3><P CLASS="para"> 1564A number of common problems are caused by incorrect Internet address routing or the incorrect assignment of addresses. This section helps you determine what your addresses are.</p><DIV CLASS="sect3"> 1565<H4 CLASS="sect3"> 1566<A CLASS="title" NAME="ch09-21203"> 15679.2.9.1 Netmasks</a></h4><P CLASS="para">The netmasks tell each machine which addresses can be reached directly (are on your local network) and which addresses require forwarding packets through a router. If the netmask is wrong, the machines will make one of two mistakes. One is to try to route local packets via a router, which is an expensive way to waste time - it may work reasonably fast, it may run slowly, or it may fail utterly. The second mistake is to fail to send packets for a remote machine to the router, which will prevent them from being forwarded to the remote machine.</p><P CLASS="para"> 1568The netmask is a number like an IP address, with one-bits for the network part of an address and zero-bits for the host portion. The netmask is literally used to mask off parts of the address inside the TCP/IP code. If the mask is 255.255.0.0, the first 2 bytes are the network part and the last 2 are the host part. More common is 255.255.255.0, in which the first 3 bytes are the network part and the last one is the host part.</p><P CLASS="para"> 1569For example, let's say your IP address is 192.168.0.10 and the Samba server is 192.168.236.86. If your netmask happens to be 255.255.255.0, the network part of the addresses is the first 3 bytes and the host part is the last byte. In this case, the network parts are different, and the machines are on different networks: </p><TABLE CLASS="informaltable" BORDER="1" CELLPADDING="3"> 1570<THEAD CLASS="thead"> 1571<TR CLASS="row" VALIGN="TOP"> 1572<TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 1573<P CLASS="para"> 1574Network Part</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 1575<P CLASS="para"> 1576Host Part</p></th></tr></thead><TBODY CLASS="tbody"> 1577<TR CLASS="row" VALIGN="TOP"> 1578<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1579<P CLASS="para"> 1580192 168 000</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1581<P CLASS="para"> 158210</p></td></tr><TR CLASS="row" VALIGN="TOP"> 1583<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1584<P CLASS="para"> 1585192 168 235</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1586<P CLASS="para"> 158786</p></td></tr></tbody></table><P CLASS="para"> 1588If your netmask happens to be 255.255.0.0, the network part is just the first two bytes. In this case, the network parts match and so the two machines are on the same network: </p><TABLE CLASS="informaltable" BORDER="1" CELLPADDING="3"> 1589<THEAD CLASS="thead"> 1590<TR CLASS="row" VALIGN="TOP"> 1591<TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 1592<P CLASS="para"> 1593Network Part</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 1594<P CLASS="para"> 1595Host Part</p></th></tr></thead><TBODY CLASS="tbody"> 1596<TR CLASS="row" VALIGN="TOP"> 1597<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1598<P CLASS="para"> 1599192 168</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1600<P CLASS="para"> 1601000 10</p></td></tr><TR CLASS="row" VALIGN="TOP"> 1602<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1603<P CLASS="para"> 1604192 168</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1605<P CLASS="para"> 1606236 86</p></td></tr></tbody></table><P CLASS="para"> 1607Of course, if your netmask says one thing and your network manager says another, the netmask is wrong.</p></div><DIV CLASS="sect3"> 1608<H4 CLASS="sect3"> 1609<A CLASS="title" NAME="ch09-45060"> 16109.2.9.2 Broadcast addresses</a></h4><P CLASS="para"> 1611The broadcast address is a normal address, with the hosts part all one-bits. It means "all hosts on your network." You can compute it easily from your netmask and address: take the address and put one-bits in it for all the bits that are zero at the end of the netmask (the host part). The following table illustrates this: </p><TABLE CLASS="informaltable" BORDER="1" CELLPADDING="3"> 1612<THEAD CLASS="thead"> 1613<TR CLASS="row" VALIGN="TOP"> 1614<TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 1615<P CLASS="para"> 1616</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 1617<P CLASS="para"> 1618Network Part</p></th><TH CLASS="entry" ALIGN="LEFT" ROWSPAN="1" COLSPAN="1"> 1619<P CLASS="para"> 1620Host Part</p></th></tr></thead><TBODY CLASS="tbody"> 1621<TR CLASS="row" VALIGN="TOP"> 1622<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1623<P CLASS="para"> 1624<B CLASS="emphasis.bold"> 1625IP address</b></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1626<P CLASS="para"> 1627192 168 236</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1628<P CLASS="para"> 162986</p></td></tr><TR CLASS="row" VALIGN="TOP"> 1630<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1631<P CLASS="para"> 1632<B CLASS="emphasis.bold"> 1633Netmask</b></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1634<P CLASS="para"> 1635255 255 255</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1636<P CLASS="para"> 1637000</p></td></tr><TR CLASS="row" VALIGN="TOP"> 1638<TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1639<P CLASS="para"> 1640<B CLASS="emphasis.bold"> 1641Broadcast</b></p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1642<P CLASS="para"> 1643192 168 236</p></td><TD CLASS="entry" ROWSPAN="1" COLSPAN="1"> 1644<P CLASS="para"> 1645255</p></td></tr></tbody></table><P CLASS="para"> 1646In this example, the broadcast address on the 192.168.236 network is 192.168.236.255. There is also an old "universal" broadcast address, 255.255.255.255. Routers are prohibited from forwarding these, but most machines on your local network will respond to broadcasts to this address.</p></div><DIV CLASS="sect3"> 1647<H4 CLASS="sect3"> 1648<A CLASS="title" NAME="ch09-pgfId-946136"> 16499.2.9.3 Network address ranges</a></h4><P CLASS="para">A number of address ranges have been reserved for testing and for non-connected networks; we use one of these for the book. If you don't have an address yet, feel free to use one of these to start with. They include one class A (large) network, 10.*.*.*, and 254 class C (smaller) networks, 192.168.1.* through to 192.168.254.*. In this book we use one of the latter, 192.168.236.*. The domain <I CLASS="filename"> 1650example.com</i> is also reserved for unconnected networks, explanatory examples, and books.</p><P CLASS="para"> 1651If you're actually connecting to the Internet, you'll need to get a real network and a domain name, probably through the same company that provides your connection.</p></div><DIV CLASS="sect3"> 1652<H4 CLASS="sect3"> 1653<A CLASS="title" NAME="ch09-pgfId-947786"> 16549.2.9.4 Finding your network address</a></h4><P CLASS="para">If you haven't recorded your IP address, it will be displayed by the <KBD CLASS="command"> 1655ifconfig</kbd> command on Unix or by the IPCONFIG command on Windows 95 and NT. (Check your manual pages for any options required by your brand of Unix: Sun wants <CODE CLASS="literal"> 1656ifconfig</code> <CODE CLASS="literal"> 1657-a</code>). You should see output similar to the following:</p><PRE CLASS="programlisting"> 1658server% ifconfig -a 1659le0: flags=63<UP,BROADCAST,NOTRAILERS,RUNNING > 1660 inet 192.168.236.11 netmask ffffff00 broadcast 192.168.236.255 1661lo0: flags=49<&lt>UP,LOOPBACK,RUNNING<&gt> 1662 inet 127.0.0.1 netmask ff000000</pre><P CLASS="para"> 1663One of the interfaces will be loopback (in our examples <CODE CLASS="literal"> 1664lo0</code>), and the other will be the regular IP interface. The flags should show that the interface is running, and Ethernet interfaces will also say they support broadcasts (PPP interfaces don't). The other places to look for IP addresses are <I CLASS="filename"> 1665/etc/hosts</i> files, Windows <EM CLASS="emphasis"> 1666HOSTS</em> files, Windows <EM CLASS="emphasis"> 1667LMHOSTS</em> files, NIS, NIS+ and DNS.</p></div></div><DIV CLASS="sect2"> 1668<H3 CLASS="sect2"> 1669<A CLASS="title" NAME="ch09-35552">9.2.10 Troubleshooting NetBIOS Names</a></h3><P CLASS="para">Historically, SMB protocols have depended on the NetBIOS name system, also called the LAN Manager name system. This was a simple scheme where each machine had a unique 20-character name and broadcast it on the LAN for everyone to know. With TCP/IP, we tend to use names like <EM CLASS="emphasis"> 1670client.example.com</em> stored in <I CLASS="filename"> 1671/etc/hosts</i> files, through DNS or WINS.</p><P CLASS="para"> 1672The usual mapping to domain names such as <EM CLASS="emphasis"> 1673server.example.com</em> simply uses the <EM CLASS="emphasis"> 1674server</em> part as the NetBIOS name and converts it to uppercase. Alas, this doesn't always work, especially if you have a machine with a 21-character name; not everyone uses the same NetBIOS and DNS names. For example, <EM CLASS="emphasis"> 1675corpvm1</em> along with <EM CLASS="emphasis"> 1676vm1.corp.com</em> is not unusual.</p><P CLASS="para"> 1677A machine with a different NetBIOS name and domain name is confusing when you're troubleshooting; we recommend that you try to avoid this wherever possible. NetBIOS names are discoverable with <EM CLASS="emphasis"> 1678smbclient </em>:</p><UL CLASS="itemizedlist"> 1679<LI CLASS="listitem"> 1680<P CLASS="para"> 1681<A CLASS="listitem" NAME="ch09-pgfId-946160"> 1682</a>If you can list shares on your Samba server with <EM CLASS="emphasis"> 1683smbclient</em> and a <CODE CLASS="literal"> 1684-L</code> option (list shares) of <CODE CLASS="replaceable"> 1685<I> 1686short_name_of_server</i></code>, the short name is the NetBIOS name.</p></li><LI CLASS="listitem"> 1687<P CLASS="para"> 1688<A CLASS="listitem" NAME="ch09-pgfId-946161"> 1689</a>If you get "Get_Hostbyname: Unknown host name," there is probably a mismatch. Check in the <I CLASS="filename"> 1690smb.conf</i> file to see if the NetBIOS name is explicitly set.</p></li><LI CLASS="listitem"> 1691<P CLASS="para"> 1692<A CLASS="listitem" NAME="ch09-pgfId-946162"> 1693</a>Try again, specifying <CODE CLASS="literal"> 1694-I</code> and the IP address of the Samba server (e.g., <CODE CLASS="literal"> 1695smbclient</code> <CODE CLASS="literal"> 1696-L</code> <CODE CLASS="literal"> 1697server</code> <CODE CLASS="literal"> 1698-I</code> <CODE CLASS="literal"> 1699192.168.236.86</code>). This overrides the name lookup and forces the packets to go to the IP address. If this works, there was a mismatch.</p></li><LI CLASS="listitem"> 1700<P CLASS="para"> 1701<A CLASS="listitem" NAME="ch09-pgfId-946163"> 1702</a>Try with <CODE CLASS="literal"> 1703-I</code> and the full domain name of the server (e.g., <CODE CLASS="literal"> 1704smbclient</code> <CODE CLASS="literal"> 1705-L</code> <CODE CLASS="literal"> 1706server</code> <CODE CLASS="literal"> 1707-I</code> <CODE CLASS="literal"> 1708server.example.com</code>). This tests the lookup of the domain name, using whatever scheme the Samba server uses (e.g., DNS). If it fails, you have a name service problem. You should reread the section <A CLASS="xref" HREF="ch09_02.html#ch09-23768"> 1709Section 9.2.8</a> after you finish troubleshooting the NetBIOS names.</p></li><LI CLASS="listitem"> 1710<P CLASS="para"> 1711<A CLASS="listitem" NAME="ch09-pgfId-946168"> 1712</a>Try with <CODE CLASS="literal"> 1713-n</code> (NetBIOS name) and the name you expect to work (e.g., <CODE CLASS="literal"> 1714smbclient</code> <CODE CLASS="literal"> 1715-n</code> <CODE CLASS="literal"> 1716server</code> <CODE CLASS="literal"> 1717-L</code> <CODE CLASS="literal"> 1718server-12</code>) but without overriding the IP address through <CODE CLASS="literal"> 1719-I</code>. If this works, the name you specified with <CODE CLASS="literal"> 1720-n</code> is the actual NetBIOS name of the server. If you receive "Get-Hostbyname: Unknown host MARY," it's not the right server yet.</p></li><LI CLASS="listitem"> 1721<P CLASS="para"> 1722<A CLASS="listitem" NAME="ch09-pgfId-946169"> 1723</a>If nothing is working so far, repeat the tests specifying <CODE CLASS="literal"> 1724-U</code> <CODE CLASS="replaceable"> 1725<I> 1726username</i></code> and <CODE CLASS="literal"> 1727-W</code> <CODE CLASS="replaceable"> 1728<I> 1729workgroup</i></code>, with the username and workgroup in uppercase, to make sure you're not being derailed by a user or workgroup mismatch.</p></li><LI CLASS="listitem"> 1730<P CLASS="para"> 1731<A CLASS="listitem" NAME="ch09-pgfId-953522"> 1732</a>If nothing works still and you had evidence of a name service problem, troubleshoot name service in the section <A CLASS="xref" HREF="ch09_02.html#ch09-23768"> 1733Section 9.2.8</a>, and then return to NetBIOS name service.</p></li></ul></div></div></blockquote> 1734<div> 1735<center> 1736<hr noshade size=1><TABLE WIDTH="515" BORDER="0" CELLSPACING="0" CELLPADDING="0"> 1737<TR> 1738<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172"> 1739<A CLASS="sect1" HREF="ch09_01.html" TITLE="9.1 The Tool Bag"> 1740<IMG SRC="gifs/txtpreva.gif" ALT="Previous: 9.1 The Tool Bag" BORDER="0"></a></td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 1741<A CLASS="book" HREF="index.html" TITLE=""> 1742<IMG SRC="gifs/txthome.gif" ALT="" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 1743<A CLASS="sect1" HREF="ch09_03.html" TITLE="9.3 Extra Resources"> 1744<IMG SRC="gifs/txtnexta.gif" ALT="Next: 9.3 Extra Resources" BORDER="0"></a></td></tr><TR> 1745<TD ALIGN="LEFT" VALIGN="TOP" WIDTH="172">9.1 The Tool Bag</td><TD ALIGN="CENTER" VALIGN="TOP" WIDTH="171"> 1746<A CLASS="index" HREF="inx.html" TITLE="Book Index"> 1747<IMG SRC="gifs/index.gif" ALT="Book Index" BORDER="0"></a></td><TD ALIGN="RIGHT" VALIGN="TOP" WIDTH="172"> 17489.3 Extra Resources</td></tr></table><hr noshade size=1></center> 1749</div> 1750 1751<!-- End of sample chapter --> 1752<CENTER> 1753<FONT SIZE="1" FACE="Verdana, Arial, Helvetica"> 1754<A HREF="http://www.oreilly.com/"> 1755<B>O'Reilly Home</B></A> <B> | </B> 1756<A HREF="http://www.oreilly.com/sales/bookstores"> 1757<B>O'Reilly Bookstores</B></A> <B> | </B> 1758<A HREF="http://www.oreilly.com/order_new/"> 1759<B>How to Order</B></A> <B> | </B> 1760<A HREF="http://www.oreilly.com/oreilly/contact.html"> 1761<B>O'Reilly Contacts<BR></B></A> 1762<A HREF="http://www.oreilly.com/international/"> 1763<B>International</B></A> <B> | </B> 1764<A HREF="http://www.oreilly.com/oreilly/about.html"> 1765<B>About O'Reilly</B></A> <B> | </B> 1766<A HREF="http://www.oreilly.com/affiliates.html"> 1767<B>Affiliated Companies</B></A><p> 1768<EM>© 1999, O'Reilly & Associates, Inc.</EM> 1769</FONT> 1770</CENTER> 1771</BODY> 1772</html> 1773