For data transfer between Windows and Ubuntu, we are accustomed to using FTP tools, but some students still asked about the construction and use of the samba server. This is the reason for this article.
Ubuntu version: Ubuntu16.04 for ARM bare metal first phase enhanced version
Introduction
Samba is a standard suite for file transfer between Windows and Linux and unix. Official website: https://www.samba.org/
Install samba
[email protected]:~$ sudo apt-get install samba -y
Modify the configuration file
I found that the vim installed in the built-in Ubuntu is a simplified version, and many buttons are abnormal, so install the full version of vim first:
[email protected]:~$ sudo apt-get install vim -y
Then use vi to modify the smb configuration file
[email protected]:~$ sudo vi /etc/samba/smb.conf
Append the following at the end of the file:
[ samba]
path = /work
available = yes
valid users = book
writeable = yes
Explanation:
[ samba] Comment content, you can write whatever you want
path is used to specify the directory to be shared
available Is the directory valid
valid users specify who can access, if not specified, everyone can access
whether writeable
Add the samba user and enter the password
[email protected]:~$ sudo smbpasswd -a book
Restart the samba server
[email protected]:~$ sudo service smbd restart
Access the /work directory from Windows
Win + R call out the run box, enter \ip to access (my ubuntu IP is 10.0.0.220)
Then enter the user name: book and password (the password is set in step 4)
After the correct input, you can see the files in the /work directory, and then Windows and Ubuntu can transfer the files as you like
Then continue to the next step, enter the address
Finally, this network folder will be generated, double-click to open it:
( Finish)
Recommended Posts