Have you ever heard about Samba? Here, we will briefly introduce this software and present the top way to Setup Samba on Ubuntu 22.04. Samba is actually a software by which users can access all files, resources, or printers that exist jointly in the network or Internet of companies and other cases. The best feature that can be mentioned about this tool is that Samba is available in the repositories of almost all Linux distributions and is easy to install.
Samba software is a free and open-source implementation of the SMB protocol used to integrate servers and desktops that are equipped with Linux or Unix systems and are located in environments with Microsoft’s active directory service. Another function of this software is to be used as a controller for the domain or as a normal member.
Samba software uses common SMB/CIFS protocols. CIFS is an open-type protocol of SMB. That is, if your programs are compatible with SMB or CIFS, they can communicate with a Samba server. Some Linux desktops have a Samba client by default. The Samba client is called smbclient.
There are some requirements before you start your installation process:
– A Linux VPS with the Ubuntu OS
– Root access or Sudo privileges
Here, we are going to show how to install and setup Samba on Ubuntu. So, follow the instructions below:
If you want to install Samba on Ubuntu, first of all, you should update your system to the last version. Use this command to run the system update:
sudo apt update
In your next step, use the APT package manager in your command line to start the installation process. The installation package already exists on your system repository so you don’t need to add anything more:
sudo apt install samba
Now, check the status using the following command:
systemctl status smbd --no-pager -l
The following command will help you to make the service enabled to start the program automatically:
sudo systemctl enable --now smbd
To do the configuration of Samba on the Ubuntu operating system, use the command below:
Then find the Workgroup line and replace it with your own group:
To be able to access files shared via the SMB protocol, you must whitelist and allow the service in the firewall, outside of the computer. To do this, apply the following command:
sudo ufw allow samba
To add the current user to the Sambashare group, apply the command below and access all files and folders shared:
sudo usermod -aG sambashare $USER
Now, you should set a password for share. Note that, this one should be different from the system password:
sudo smbpasswd -a $USER
$USER is your current user, but if you want to replace another user, you can change this one with your own user. The shared files or folders should be accessible to that particular user.
As an alternative, you can use the commands below to add users to Sambagroup:
sudo usermod -aG sambashare your-user
Then to set a password use:
sudo smbpasswd -a your-user
As you configured the user to use Samba, you can test it using the instructions below. e.g. sharing a picture folder. Find your desired folder and right-click on it. Choose the Properties and then Local Network Share:
If you want to delete or create files from the shared directory, you should mark the box for Allow others to create and delete files in this folder. To log in or access the shared folder you can select the Guest Access option. In the end, to create the sharing point, click on Create Share:
As soon as you see the following message on your screen, click on the “Add the permissions automatically“:
To access the remotely shared folder on Ubuntu 22.04, we will use Debian. Also, you can use Windows or MacOS:
– Go to File Manager and select Other Locations.
– Then type your Ubuntu 22.04 Samba IP address in the format below:
– You should replace ip-address with the samba server IP and Shared-folder-name with the folder you shared before:
Now you will enter the credentials. Here, you should select the Registered User and give the Username and Password which is set to use in Samba:
Now, you will have all the content of the remote Ubuntu through the Samba protocol:
This article was prepared to show how to install and setup Samba on Ubuntu 22.04. We also thought about how you can set the firewall to use the software. This implementation is a useful utility that can help in sharing different files and folders. Study this content carefully and enjoy using it. If you have any questions, please live a comment.
The main directory is /etc/samba/smb. conf for the configuration file.
NFS is used for Unix-based systems and is good for faster file sharing. Samba is a Windows-based software that gives file and print services.
How useful was this post?
Click on a star to rate it!
Average rating 0 / 5. Vote count: 0
No votes so far! Be the first to rate this post.
In today's fast-paced digital world, a stable and reliable network connection is crucial for se...
What is your opinion about this Blog?