X
Tech

Vista Hands On #13: Connect to a shared folder on a Linux machine

Trying to get Vista and Linux to talk to each other? It isn't as easy as it should be. Today I explain what I had to do to make shared folders on a Linux machine reachable from a PC running Windows Vista.
Written by Ed Bott, Senior Contributing Editor

As I noted earlier this week, I’ve been trying to get a Linux box installed on my network so I can explore interoperability issues between Windows and Linux. I can now report that I have succeeded in installing Ubuntu Linux 6.10 and it seems to be running well.

First problem I ran into was that the Vista machine couldn’t access shared resources on the Linux box and vice versa. I had no problem passing files back and forth between the Linux box and one running Windows XP. This post deals with the first problem, connecting to the shared resources on the Linux box. (I’ll tackle the issue of connecting to a Vista share in a follow-up post.)

There are two possible reasons why a Vista user can’t connect to a Linux share:

1. Windows Vista changes the authentication method for password-protected shares. In XP and previous versions, the system by default used two password hashes, the old-style LAN Manager (LM) and the newer NTLM version 2 (NTLMv2). (If you want the gory details, read this excellent article by Windows security guru Jesper Johansson. Although it was written using a beta version of Vista, the information is still accurate.) Older versions of the Samba server in Linux use only the LM hash, which means they have no trouble connecting to a default installation of XP but will fail when trying to talk to a default installation of Vista.

To fix this problem, you need to update the version of Samba on the Linux machine to 3.0.22 or higher. (If you’re using an earlier Samba version, you can downgrade Vista’s authentication to accept LM hashes, using either Local Security Policy Manager or a registry edit. I don’t recommend this option.)

2. Challenge #2 was to get Samba configured on the Ubuntu Linux machine. In my case, the samba-common package was installed and was at the correct revision (3.0.22–1), but the samba package itself was missing. (Update: On a second machine when I tried a clean install, smbfs was missing as well, and I was unsuccessful until I installed it.) After I installed the missing pieces, I had one more step to run through. From a Terminal window, I needed to add a Samba user and password. Windows users are accustomed to having file sharing and authentication handled using the credentials for their user account, but with a Samba server the databases are different. The syntax, in my case, was fairly straightforward:

sudo smbpasswd -a username

In this command, username is the same as my account name. You can create an account for another user as long as they already exist in the user account database.

(Note that you have to respond to three password prompts at this point. The first is for the root password of the logged-on user, and the next two set the SMB password for the user whose account you’re adding.)

After going through these steps, I was able to access shared folders on the Linux machine.

If any Linux experts in the audience want to add any comments or corrections or suggestions, hit the Talkback button and fire away. You can also reach me via e-mail by using the email link on my bio page.

Editorial standards