Fun with Samba

Album Cover: Blue Room EP

"Such a rush to do nothing at all."
Coldplay / Such a Rush

Posted on April 10, 2004 12:27 AM in Computers
Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

The past two days I have literally been on the verge of ripping my hair out trying to get my new XP workstation to talk to my Linux box. Since I'm just a shade past newbie when it comes to Linux, I've been reading documentation from the far reaches of the Web and trying desperately to figure out how Samba works. Redhat 9 has all kinds of great graphical interfaces to options for your web server, your samba server settings and shares, etc., but most of the time you end up getting your hands dirty at the command line before you get things working.

The biggest problem I was having was getting my XP machine to recognize shares on my Linux box. I could do whatever I wanted from the Linux end, including viewing web pages served by Apache on XP and all of my XP shares. However, I wasn't able to view any web pages served by my Linux box from Windows, and while I was able to see the Linux box showing up in My Network Places, I couldn't access it.

I'm the kind of guy that likes figuring things out. However, there comes a point where it just isn't fun anymore and I just want things to work. Typically when I run into trouble I'll use Google to find information on the problem, hoping that others have run into it in the past. Once in a blue moon you'll run into one of those problems that seems to have never happened before to anyone else in the world, but for the most part others have been down the same path. In the case of my recent problem, though, information was so diluted and contradictory that it made finding help a complete and total nightmare.

Persistence always seems to pay off in the end, though, and so it did this time around. Getting XP to let me view pages served up by Apache on my Linux machine was fairly straightforward (if working on something for two days can pass for straightforward) – I simply needed to turn off the firewall on Linux so that it would accept web requests from the Windows machine. A firewall is completely unnecessary on the Linux box anyway, since my entire network is behind a firewall as it is.

The tricky (and most frustrating) part was getting Samba working with XP. I suppose I should be thankful, because in the process of struggling with the problem I found some great documentation worth recommending to anyone, and learned a whole heck of a lot about administering shares on Linux. In the end, it all came down to one line in my smb.conf file. For some reason, Redhat 9's default smb.conf contains the following line:

hosts allow = 192.168.1 192.168.2 127.

Granted, the line is originally commented out, but when you're messing with your smb.conf file for as long as I was, you uncomment and re-comment just about as many lines as you can trying to get things working. I eventually ended up with:

hosts allow = 192.168.1 127.

I did this so that any of the local IP addresses on the network would be able to access the share, and so that the Linux box (127.) could access it as well (even though this is a little redundant). The one thing I missed, though, is that my internal IP addresses all look like 192.168.0.x, not 192.168.1.x! All it took was a switch from 1 to 0 and I was up and running...finally!

The moral of the story? Well, I suppose there are a few I could list. Don't ever give up. Eventually, with enough Code Red and determination you can and will figure things out. Also, don't take for granted the fact that you will be about 10 times wiser by the time you have figured things out. You may be missing some hair and your wall may have a few holes in it when all is said and done, but walls are overrated and we're all going to lose our hair some day anyway, right?

Comments

No one has added any comments.

Post Comments

If you feel like commenting on the above item, use the form below. Your email address will be used for personal contact reasons only, and will not be shown on this website.

Name:

Email Address:

Website:

Comments:

Check this box if you hate spam.