First in ubuntu configuration:
Open Terminal: ctrl+alt+t
1. Install Samba services:
sudo apt-get install Samba
2. If you need to create a new shared directory:
sudo midir [catalogue]
3. Open the writable permission that requires the shared directory:
sudo chmod 777 [catalogue]
4. Open the configuration file smb.conf
sudo gedit/etc/samba/smb.conf
Make the following changes:
Security = User
Then smb.conf finally add the following:
[Myshare]: Display the shared file name, can go to any name
Comment = My share directory
Path = Shared Pathname: It is important to note whether you need to add a user name problem to the pathname, for example:/home/code should actually write:/home/ubuntu1204 (username)/code
browseable = yes
writable = yes
Finally click Save to close the file
5. Back to Ubuntu terminal, create User: sudo useradd [username]
6. Assign the user to the SMB group: sudo smbpasswd-a [username] and enter two passwords, the assignment group succeeds
7. Restart Samba services: sudo service Smba restart
Windows
In the Windows system, open the Run window with Win+r, enter the IP address of the \\ubuntu in the window, and then tap the file you want to access to enter the user name and password.
The user name and password are the user name and group password that you added in Ubuntu
*: How to view Ubuntu IP address, in Ubuntu terminal input Ifconfig can see
Bug
Samba Service configuration: Implementing file sharing between Ubuntu and Windows