Creating a Samba Server on Ubuntu to Access Files from File Explorer in Windows 10
In this article, we will walk you through the process of creating a Samba server on a local Ubuntu machine and accessing it from a Windows 10 machine using File Explorer. By the end of this article, you will be able to add and access files on your Ubuntu machine from your Windows 10 machine.
What is Samba?
Samba is an open-source software that enables interoperability between Linux and Windows systems. It allows Linux systems to act as file and print servers for Windows clients, making it possible to share files and printers between the two systems.
Prerequisites
Before we begin, make sure you have the following:
- An Ubuntu machine with SSH access
- A Windows 10 machine
- Both machines connected to the same network
Installing Samba on Ubuntu
To install Samba on Ubuntu, open a terminal and run the following commands:
sudo apt update
sudo apt install samba samba-common-bin
Configuring Samba
After installing Samba, we need to configure it to share a directory. In this example, we will share the /home directory.
First, create a new Samba configuration file using the following command:
sudo nano /etc/samba/smb.conf
Add the following lines to the end of the file:
[home]
path = /home
writeable = yes
create mask = 0777
directory mask = 0777
public = yes
This configuration shares the /home directory with read and write permissions for all users, and makes it publicly accessible.
Save and close the file, then restart the Samba service with the following command:
sudo systemctl restart smbd
Accessing the Samba Share from Windows 10
To access the Samba share from Windows 10, open File Explorer and click on "Network" in the left-hand menu.
You should see your Ubuntu machine listed under "Network". Double-click on it to open the shared directories.
You should now see the shared directories, in this case, the /home directory. You can now add and access files as needed.
In this article, we covered the process of creating a Samba server on a local Ubuntu machine and accessing it from a Windows 10 machine using File Explorer. By following the steps outlined in this article, you can easily share files between your Ubuntu and Windows 10 machines.
References
- Samba Documentation
- Ubuntu Samba File Server Guide
- How to Create a Samba File Server and Share Directories on Ubuntu 20.04
--endarticle--