Today we will see how we can share files between Ubuntu (Linux) and Windows in a simple way using our local network to facilitate all this task.
Installing Samba on Ubuntu 16
First, we must install Samba on the Ubuntu 16, remember that Samba is a protocol that allows GNU / Linux, Mac OS or Unix computers to act as clients in Windows networks and in this way facilitate the transfer between both systems.
Once the terminal is open, we will enter the following command for the installation of Samba in Ubuntu 16 and thus enable the file exchange:
sudo apt-get install Samba
Defining the Folder to Share
The next step is to define which folder we have to share between Ubuntu 16 and Windows 10, for this we have created a folder called TheLinuxCode in the Home of the system.
Once the folder is created, we will right click on it and from the list displayed select the Local Network Share option.
Once selected this option we will see the following window:
There we must activate the “Share this folder” box and the boxes “Allow others to create and delete files in this folder” and “Guest Access (for people without a user account”) must be enabled.
Click on Create Share to share the folder that we have created and the following window will be displayed:
There we must click on the option Add the permissions automatically to apply the permissions in the shared folder. We can see that our folder has been shared (It includes two arrows indicating that it is shared).
Set password in Shared Folder
If we want to assign a password to the shared folder we must access the terminal and enter the following command:
sudo smbpasswd -a User_Name
Thanks to this configuration every time we access from Windows 10 to the shared folder in Ubuntu 16, a username and password will be requested.
Access Ubuntu shared folder from Windows 10
To access the shared folder we will perform the following process in Windows 10. We use the key combination: Win + R
It is the Run window and we must enter the following syntax:
To find the IP address on our Ubuntu 16 machine we can use the ifconfig command . In this case our IP is 192.168.0.32 so we will use the following line in the Run command:
Click OK and we will see that we will have access to the indicated folder. Now all the elements that we define in the Ubuntu team will be accessed from Windows 10.
Or in the same way, the files that we enter in this folder from Windows 10 will be accessed from Ubuntu 16.
If we want to quickly access the shared folder in Ubuntu 16 we can create a shortcut in Windows 10.