1. Of course, you have to install Samba first.
Sudo apt-Get install Samba smbfs
2. Edit smb. conf
Sudo Vim/etc/samba/smb. conf
Found; security = user
Replace the following two rows:
Security = user
Username map =/etc/samba/smbusers
Add the following lines to the end of the document,
Assume that the user allowed to access is weijianhua, And the Share Name of the document folder is share,
[Share]
Comment = shared folder with username and password
Path = "document directory to be shared"
Public = Yes
Writable = Yes
Valid users = weijianhua
Create mask = 0700
Directory mask = 0700
Force user = nobody
Force Group = nogroup
Available = Yes
Browseable = Yes
Then find [Global] and change workgroup = mshome
Workgroup = workgroup
Displays charset = UTF-8
UNIX charset = UTF-8
DOS charset = cp936
3. Add a user's samba password: (this is very important !!!)
Sudo smbpasswd-A weijianhua
Sudo gedit/etc/samba/smbusers
Add the following line to the newly created document and save it.
Weijianhua = "Network username"
4. Restart the samba service:
Sudo/etc/init. d/samba restart
Finally, log out and log on again or restart the machine.
In this way, you can directly MAP network disks in windows, which is convenient ......