Saturday, 2 January 2010

Windows 7 and Samba Shares

This is a quick guide to setting up Samba file sharing on my Viglen MPC-L server which is running Ubuntu 8.04.3 LTS. The client is a Windows 7 machine – no changes to the registry or local security policy were needed. The following applies to the version of samba from the repositories -   smbd version 3.0.28a.

1. Install Samba

sudo apt-get install samba smbfs

2. Edit Samba Configuration File

Find the line which is commented out - “;   security=user” and change it to: -
security = user

username map = /etc/samba/smbusers

Find the line “encrypt passwords = no” and change it to “encrypt passwords = true”

Add a section for each share that you want to be available: -

browseable = yes

comment = Data

path = /data

force user = viglen

force group = users

read only = No

guest ok = Yes

3. Add “smbusers” file

A new file is now needed to map smb users onto local linux users. Create the file: -
sudo vi /etc/samba/smbusers

and add the following to it: -
viglen = "viglen"

4. Change  SMB Password for user

Set a password for the viglen smb user by running the following command: -
sudo smbpasswd viglen

5. Restart Samba

sudo /etc/init.d/samba restart

6. Test Connection from Windows

Open a windows command prompt (Start -> cmd) and enter the following command (with the correct IP address and password)
net use q: \\aaa.bbb.ccc.ddd\data password /user:viglen

You should get a message “The command completed successfully.”, and Q: should be accessible through Windows Explorer etc.

To remove the share, enter the following command: -
net use /d q:

No comments:

Post a Comment