Install Samba:

sudo apt-get install samba
sudo apt-get install smbfs

Setup

cd /
sudo mkdir data
chmod 777 data

Open file: /etc/samba/smb.conf, search “; security = user”, change to:

security = user
username map = /etc/samba/smbusers

the same time add the following code in the end:

[data]
comment = data
path = /data
public = yes
writable = true
valid users  = tony
create mask = 0775
force user = tony
force group = tony
available = yes
browseable = yes

Add user, “tony” is my user, if you want use other username, you can create it:

sudo smbpassed -a tony #add "tony", and set password
sudo vi /etc/samba/sambusers #create "sambausers",and change tony = "tony"

Test and restart:

sudo testparam
sudo /etc/init.d/samba restart

Use
In Windows system, right click “Computer” -> Map Desk -> Folder,choose the desic name and key in “//ip/data”, click “Yes”, key in password. Now you can look the samba folder.
Trouble Shooting

unix extensions = no

this code need add in [blobalthe following code need add in [data]:

wide links = yes
follow symlinks = yes