Windows 98 File Sharing: Broken By Design

Or, “what part of guest access don’t you understand?”

It sounds so deceptively simple. There’s a LAN with a Windows 98 machine and my Linux box. We want to share files between the two. If you were naive, you might think that file sharing could be the answer.

The Linux side isn’t too hard to set up, thanks to Samba. I’m certainly no expert on it, but the documentation and configuration examples helped me set up something that seems to work. I have no problem mounting shares hosted on my Linux box to itself.

So, the trick is how to get Windows 98 to mount the share. It shouldn’t be too hard — the share has guest access enabled to keep things simple. LAN security isn’t much of a concern, since access to the network is controlled and all access to file sharing from the outside world is blocked at the router. What could be easier than mounting a share when no password, not even a user name, is required? It sounds like a two-step protocol:

1. Win98 to Linux: “Hey, gimme access.”

2. Linux to Win98: “OK.”

Of course, Windows 98 is painfully, breathtakingly stupid in this regard. First, the developers assumed that if you have a user name when you log into the local machine, that’s obviously going to be your user name for all your accounts on any other machines on the network. So, when it tries to connect to a share, it always uses the local user name. There’s no way to tell it to use a different name. None. The only work-around would be to change the name of the local user. Naturally, you’re screwed if you want to mount two file shares with — horror of horrors — two different user names!

Now, I knew about this ahead of time. That’s why I decided to make the share offered by my Linux box use guest access, to avoid any possible evilness with user names. It’s not ideal, but with a pair of read-only shares, one on each machine, you can at least transfer files either way. It’s ugly, but it works.

It sounds like a perfect plan, but alas, Windows 98 outsmarts (or, rather, outstupids) us here. For, you see, even if guest access is enabled for a share, if there’s a local user name available, it will try to use that when connecting! It never even tries to connect to the share as a guest! In Windows Explorer, it keeps trying to ask for a password for the share, even though nothing will ever work (there’s no password at all!). Trying to use the net use command doesn’t work either — it returns a bizarre “error 5″ suggesting it couldn’t read the share. I suspect what it really means is that it couldn’t connect with the user name and an empty password.

But Paul, you say, while Windows 98 has more than its share of annoyances, surely it can’t be so painfully, astoundingly, precedent-shatteringly, fabric-of-the-universe-rendingly stupid to actually exhibit this behavior! Isn’t it possible that you have simply misconfigured Samba on your Linux box, in such a way that the Windows machine can’t talk to it, or isn’t really giving guest access, or some such?

You could say that, but you’d be wrong, and I have the Samba logs to prove it. Windows 98 is indeed trying to send a user name and password pair when mounting the share, and when that fails (since there’s no user name and password needed at all), it gives up. I’ve tried every permutation of Samba configuration options I can think of, to no avail. I’ve checked and double-checked the firewalls at each end to make sure no ports were being blocked. And mounting the share on my Linux box, explicitly using the “-o guest” option, works flawlessly and with no mention of user names and passwords in the logs.

After spending too many hours banging my head against this brick wall, I say, screw it. SCP may be awkward, but it works fine, so that’s what I’ll use.

*shakes fist at Redmond*

3 Responses

  1. In the spirit of old Gentoo Linux forums, I ask can the logs for Samba be seen, Windows may be stupid but it isnt this stupid, I am living proof since I am using Samba between Gentoo and Xp right now.

  2. All the versions of Windows derived from the NT code base, including Windows XP, have a fairly sane implementation of file sharing and don’t suffer from this problem. I’ve done cross-user mounting on Win2K and WinXP without any problem.

    However, the Windows 95/98 (and I presume Me as well) don’t allow you to specify user names in any way. The help for “net use”, for example, entirely lacks the /USER flag.

    To be fair, however, I still can’t tell if the real cause of the problem is the Win98 end or some subtle misconfiguration of Samba. I see a few things in the logs that look a little weird, so there still may be hope to get this to work.

    If I still don’t have any luck, I don’t see what harm posting the relevant logs could have.

  3. After another hour or so of poking around in /etc/samba/smb.conf, it appears I got things into some semblance of working! I don’t know what exactly did it, since I was fiddling with pretty much everything. I think it may have had something to do with mapping all users to user nobody (i.e., the account for guest access), along with some other changes that I’m afraid I don’t fully understand. This would at least seem to get around Windows 98′s apparent insistence on logging in as *somebody*.

    What I’ve done is offer my entire hard drive as a guest-access share under user nobody. This effectively makes it a read-only share except for /tmp. Downloading files from my computer is easy. Uploading them requires two steps: uploading to /tmp and then, locally, moving them to wherever they should go. This certainly isn’t a particularly secure setup, but it’s just a home LAN with two effective users: me and my sister.[0] It’ll at least allow for file transfers much faster than SSH/SCP would allow — since one of the machines is an aging 133 MHz Pentium, the time needed to encrypt and decrypt limited transfer rates to 30-40 KB/sec.

    The configuration I have now could probably be improved upon, but there’s two sayings that I think apply right now:

    1. If it ain’t broke, don’t fix it.
    2. If you’re going to fix it anyway, don’t do it at a quarter past one in the morning.

    [0] I’ve got a nifty little script I’m beta-testing right now that lets you start services only when you’re connected to a certain network; once I move my computer off the home LAN, Samba won’t get started at all.

Comments are closed.