▷ How to connect ubuntu to windows network to share folders
Table of contents:
- Connect Ubuntu to Windows network using Samba
- Install Samba in Ubuntu 18.04
- Share folder in Ubuntu and access it
- Access shared folder in Ubuntu from Windows
- Set username and password in shared folder in Ubuntu
- Create network location shortcut
- Share folder in Windows and access it from Ubuntu
- Access shared folder in Windows from Ubuntu
- Remove password restriction to access shared folder in Windows
In this article we will see how to connect an Ubuntu computer to the Windows 10 network on our home LAN. File sharing is one of the most interesting actions that we can perform on our computer, in this way we can copy and paste files from different computers, either through a LAN connection through a switch, router or via Wi-Fi.
Index of contents
Connecting two computers with Windows is very simple, especially in Windows 10. But if we have other operating systems such as Ubuntu in addition to Windows, we will have to do some extra operations, although they are also very simple using our favorite terminal. Through the Samba application, we will be able to connect different systems graphically and only by taking a few steps. Let's see how to do it.
Connect Ubuntu to Windows network using Samba
Microsoft uses the SMB protocol to establish file share usage in its operating system. This is why we will also need to install this service on our Ubuntu system, so let's start there.
Install Samba in Ubuntu 18.04
Although we are using this version of Ubuntu, the procedure will be applicable to practically any version of the system that we have in our hands.
We will proceed to open a command terminal by pressing the key combination " Ctrl + Alt + T ". Now we will place the following command to install the package from the repositories:
sudo apt-get install samba
This will start the package installation process. The fact of putting sudo in front, is because whenever we need to perform some installation on the system, we will need to temporarily rise as root to do it.
Now it would also be good practice to verify that both computers are seen through the network. For this, we will at least have to know the IP address of one of them.
For example, in Windows, we would only have to open a command prompt and put the command " ipconfig ". We will have to look at the line " IPv4 address ".
Now we go to Ubuntu and write the typical command:
ping In this way we will verify that the destination responds correctly. To stop the request process, we will press the key combination " Ctrl + Z"
Once this is done, we will be able to share a folder from Ubuntu to access it from Windows. Later we will carry out the opposite process.
Share folder in Ubuntu and access it
The procedure is quite simple, we are going to create a folder on the desktop so that it is the one we share.
Then we right-click on it, and choose the option " local network share ". A window will appear in which we can configure the different options to establish shared use.
For this case, we will activate the option of " Share this folder " and then we will also activate the two options located in the lower area to assign read and write permissions for any user.
We will confirm that we want to establish these settings in the pop-up window that appears after confirming that we want to do so. In this way we will already have the folder ready to place files and view them from our Windows client.
The next thing will be to know what IP address our Ubuntu team has, if we do not know yet. To do this, we will place the following command in the terminal:
ip to
We must locate the first line where it puts " link / ether " so we will locate the IP address of the equipment in the main network adapter.
Access shared folder in Ubuntu from Windows
Immediately we go to our Windows computer and open a file explorer window. We will place in the navigation bar the Ubuntu IP address preceded by two backslashes:
\\ We will see that the folder that we previously shared will appear immediately. In addition, we will have full access to it in terms of reading and writing, as we chose in the Ubuntu sharing configuration window. But of course, surely we want to make these folders more secure, so that not everyone can access them. Through this procedure we will configure a user and a password in Samba so that the folders we share need this authentication to access them. We will go back to the Ubuntu command terminal, and write the following command: sudo smbpasswd -a Then it will request to establish a new password for the created user. We must bear in mind that the user will have to have it created in our Ubuntu system previously, as it happens with Windows. In this way, every time we want to access a shared folder in Ubuntu, we will have to put this user and his password on the client to authenticate ourselves. But everything is not here, if we remember, previously we configured the shared folder so that it could be accessed by everyone. This, of course, we will have to modify them so that the username and password work. Then, we go back to the folder and right-click on it to again choose the option of " local network share ". We deactivate the options at the bottom of this window. Now if we go back to Windows and want to access the folder, it will ask for username and password. We have seen this on other occasions and it is quite simple. We will only have to right click and choose " New -> Shortcut ". In the first window of the wizard we place a double backslash followed by the IP address of the Ubuntu server. Then we put a name for the shortcut and everything is ready. We still have to see how to perform the reverse procedure, although many may already imagine it. It's very similar. We go to the directory we want to create or share a folder, and right click on it. We must choose the " Properties " option. Within the window that will appear, we must go to the " Share " tab, and choose " Advanced sharing... ". Once inside, we activate the " Share folder " option. Then we click on the " Permissions " button to add control permissions to the users we want, or simply to all. In the window in question, we will have all users selected by default. We are going to activate all the “ Allow ” boxes, so that any user from another system can access our network location in Windows. If we wanted to do it only with certain users, we would have to click on the " add " button and add it to the list. To add a user to the list of permissions, we will have to have it created on our Windows system. Regardless of this, the moment we access this folder from a client, it will ask us to enter the username and password of the server computer, or where appropriate, the specific user that we have given access permissions to. Well, let's see how to access this folder from Ubuntu, or any that we have shared in Windows. If we tried to do it the same way as in Windows, we would see that we do not get what we want, since there is a small trick. We are going to open the Ubuntu file explorer and we are going to access the " Other locations " directory. We are located in the text input box in the Lower area with the title " Connect to the server ". Here we will place the path as follows: smb: // We click on " Connect " so that it immediately requests a username and password to access the folder. If in the Windows user we do not have a password configured, we will not be able to access the Network Location. Finally, we are going to see how to eliminate the restriction of accessing a folder when we do not have a user password configured in Windows. We are going to place ourselves on the Windows Start button and click on it with the right button. We must choose the option " Network Connections ". In the configuration window that opens, we will have to locate the link with the name " Network and Sharing Center ". Once we access the corresponding configuration, we will have to click on the option " Change advanced sharing configuration ", located at the top left. We will open a list of options divided into three main sections. We will display the last of them " All networks ", to locate the last option of " Sharing with password protection ". Here we must check the box " Disable sharing with password protection." From now on, we will directly access the folders that we have shared, and it will not give an error if our user does not have a password. Well, with these procedures we can connect Ubuntu to the Windows network and manage interesting options both in one part and the other. We also recommend: What version of Ubuntu do you use? We hope that everything has gone wonderfully and you can connect Ubuntu to Windows network. If you have had any problem or doubt, write us in the comments.Set username and password in shared folder in Ubuntu
Create network location shortcut
Share folder in Windows and access it from Ubuntu
Access shared folder in Windows from Ubuntu
Remove password restriction to access shared folder in Windows
Nfs: share folders on linux
NFS: Network File System. Native system used by Linux that allows computers to connect and share folders with each other.
How to connect to a wifi network using the terminal
There are numerous procedures to connect to a Wi-Fi network using the Linux terminal, we will tell you which is the simplest and most efficient
▷ How to connect two network computers with windows
Connecting two computers on a network will help you share files from several computers and quickly access them ás you will see here how to do it