Thursday, 25 November 2010

If at First You Don't Succeed...

My ongoing battle with my NAS and netbios names prompted me to wonder whether I could share files between my Ubuntu machine and Windows Vista. In theory, a public share on the network from Linux should be a simple matter but, even sharing a directory as root via Samba, met with no success.

However, one thing that I have learned from my fight with my network is that trial and error only gets you so far: at some point you have to understand how things work in order to get things done. Clearly, my accumulated networking knowledge needed to be put on a more secure noetic footing if I was ever going to get my disparate operating systems and network nodes talking to one another.

In an effort to combine my practical experience with some meaningful intellectual understanding, I turned to John Ross' excellent book, Network Know-how: an essential guide for the accidental admin. It was here that I discovered how subnets are identified which, in turn, triggered my understanding of why Samba wasn't doing what I expected.

The /etc/samba/smb.conf file, specifies which hosts (servers) can connect to your machine in order to share directories and files. These are called the allowed hosts and you have to tell Samba what they are by changing the configuration file.

Open the Smb.conf file:

sudo gedit /etc/samba/smb.conf

Enter your password when prompted and the smb.conf file will open in a plain text editor. Look for the line that identifies the allowed hosts (mine is line 7) and add your LAN subnet address. For instance, if your LAN IP address is, then your LAN subnet is 192.168.1 and that's all you need to add.

Save and close the file.

Restart Samba:

sudo /etc/init.d/samba restart

Hey Presto! Suddenly all of my shares appeared in Nautilus and I could see my shared directories in File Explorer from my Windows Vista box!

But that's not the best news...

After amending my Samba configuration, I can now use netbios names rather than IP addresses meaning, in theory at least, that I can return to dynamic IP addresses and no longer worry about moving my network around!

How cool is that?

No comments:

Post a Comment