Sudo apt-get install samba
Sudo apt-get install smbfs
The following is a shared group that can read and write folders. Assume that the folder you want to share is/home/username/share.
First create this folder
Mkdir/home/messcode/share
Chmod 777/home/messcode/share
Back up and edit smb. conf to allow network users to access
Sudo cp/etc/samba/smb. conf/etc/samba/smb. conf_backup
Sudo gedit/etc/samba/smb. conf
Find the Keyword:; security = user
Replace with these rows: security = user
Username map =/etc/samba/smbusers
Add the following lines to the end of the file. Assume that the user allowed to access the file is messcode. The shared folder name is Share.
[Share]
Comment = Shared Folder with username and password
Path =/home/messcode/share
Public = yes
Writable = yes
Valid users = messcode
Create mask = 0700
Directory mask = 0700
Force user = nobody
Force group = nogroup
Available = yes
Browseable = yes
Change the value here by the way. Find [global] and change workgroup = MSHOME
Workgroup = WORKGROUP
Displays charset = UTF-8
Unix charset = UTF-8
Dos charset = cp936
The following three lines are used to prevent Chinese directory garbled characters. Depending on your local, the UTF-8 may need to be changed to cp936. Do it yourself.
Now you need to add the network access account messcode. If this account does not exist in the system, sudo useradd messcode
The above only adds the messcode user, but does not give the user a local logon password. Therefore, this user can only be remotely accessed and cannot log on from the local machine. In addition, the samba logon password can be different from the local logon password. Now you want to add a network user account:
Sudo smbpasswd-a newsfan
Sudo gedit/etc/samba/smbusers
Add the following line to the new file and save it.
Messcode = "network username"
Use this command to change the network access password of messcode in the future.
Sudo smbpasswd-a messcode
Run the command to delete the account of a network user and change-a to-x.
Sudo testparm
Sudo/etc/init. d/samba restart
Finally, log out and log on again or restart the machine.