How to Set Up a Network Shared Folder on Ubuntu With Samba
In a network environment, it’s often necessary to share folders or files between different computers in the network. Ubuntu, being a popular operating system, has its own way of accomplishing this task with Samba server. Samba allows users to share folders with systems running either Windows or Ubuntu. In this article, we will provide you with step-by-step instructions on how to set up a network shared folder on Ubuntu with Samba.
What is Samba?
Samba is a software that allows Unix-based systems to interact with Windows-based systems. It enables file and printer sharing among other systems that use the same network. It is an open-source program that makes cross-platform file sharing possible between computers running on different operating systems.
Install Samba on Ubuntu
The first thing you need to do is to install Samba on your Ubuntu desktop. To do this, open the terminal (Ctrl + Alt + T) and type:
sudo apt-get install samba
Once you enter this command, Ubuntu will begin downloading and installing Samba.
Create a Shared Folder
Now that Samba is installed, it’s time to create a shared folder that will be accessible to other computers on the network.
1. Create a new folder to share. You can do this either via the terminal or the file manager.
Via the Terminal:
sudo mkdir /home//sharedfolder
Replace with your Ubuntu username. This will create a folder called “sharedfolder” in the /home directory.
Via the File Manager:
Open the file manager and navigate to your home directory. Right-click anywhere in the empty space and select New Folder. Name it “sharedfolder.”
2. Once you have created the folder, change the folder permissions so that Samba can have access to it. You can do this via the terminal or the file manager.
Via the Terminal:
sudo chmod 777 /home//sharedfolder
Replace with your Ubuntu username.
Via the File Manager:
Right-click on the shared folder and select Properties > Permissions. Check the box that says “Make the folder writable by other users.”
Configure Samba to Share the Folder
1. Open the Samba configuration file using the terminal:
sudo nano /etc/samba/smb.conf
2. In this file, scroll down to the end and add the following lines:
[sharedfolder]
path = /home//sharedfolder
read only = no
guest ok = yes
Replace with your Ubuntu username.
3. Save and exit the file by pressing Ctrl + X, then Y and Enter.
4. Restart the Samba service by typing:
sudo service smbd restart
Accessing the Shared Folder
Now that the shared folder is set up, other computers on the network will be able to access it. To access the shared folder from another computer:
1. Open the file manager on the other computer and click “Connect to Server” in the file menu.
2. In the “Server Address” field, type the IP address of your Ubuntu machine followed by the name of the shared folder:
smb:///sharedfolder
Replace with the IP address of your Ubuntu machine.
3. Click “Connect” and provide the Ubuntu machine password if prompted.
Once connected, you will be able to view and manage the files in the shared folder.
Conclusion
By following these simple steps, you can easily set up a network shared folder on Ubuntu with Samba. This will enable your Ubuntu machine to share files and folders with other devices on the network. Samba is a useful tool that makes cross-platform file sharing between Windows and Ubuntu a breeze. With this set up, you can easily collaborate with colleagues or share files with friends and family over a local network.