Skip to main content

samba file configuration for network sharing in ubuntu 22.04 using terminal / File sharing in Ubuntu 22.04

 o configure Samba for network sharing on Ubuntu, you can follow the steps below:

  1. Install Samba: Open the terminal and type the following command to install Samba:

sudo apt-get install samba
  1. Create a shared folder: Create a folder that you want to share with other computers on the network. You can do this using the following command:

sudo mkdir /path/to/shared/folder
  1. Configure Samba: Open the Samba configuration file using the following command:

sudo nano /etc/samba/smb.conf
  1. Add a new section to the configuration file with the following details:

[ShareName] path = /path/to/shared/folder writeable = yes guest ok = yes create mask = 0777 directory mask = 0777

Replace "ShareName" with the name you want to give to the shared folder.

  1. Save the changes to the configuration file and close it.

  2. Restart Samba: Type the following command to restart the Samba service:

sudo systemctl restart smbd
  1. Allow Samba through the firewall: If you have a firewall enabled, you will need to allow Samba through it. Type the following command to allow Samba through the firewall:
sudo ufw allow samba

Once you have completed these steps, other computers on the network should be able to access the shared folder using the network path "\Ubuntu-IP-Address\ShareName" (replace "Ubuntu-IP-Address" with the IP address of your Ubuntu computer).


2 nd method :

here's a step-by-step guide on how to configure Samba with an example:

  1. Install Samba: Open the terminal and type the following command to install Samba:
csharp
sudo apt-get install samba
  1. Create a shared folder: Create a folder that you want to share with other computers on the network. For this example, let's create a folder called "SharedDocs" in the home directory of the user "johndoe". Type the following command to create the folder:
bash
sudo mkdir /home/johndoe/SharedDocs
  1. Grant permission to the shared folder: You need to grant permission to the shared folder so that other users can access it. Type the following command to give permission to the "johndoe" user:
bash
sudo chown -R johndoe:johndoe /home/johndoe/SharedDocs
  1. Configure Samba: Open the Samba configuration file using the following command:
bash
sudo nano /etc/samba/smb.conf
  1. Add a new section to the configuration file with the following details:
java
[SharedDocs] path = /home/johndoe/SharedDocs valid users = @smbgrp force group = smbgrp create mask = 0664 directory mask = 0775 read only = no

Replace "SharedDocs" with the name you want to give to the shared folder. "smbgrp" is the name of the group that will have access to the shared folder. You can replace this with a group name of your choice. "create mask" and "directory mask" are file permission settings.

  1. Save the changes to the configuration file and close it.

  2. Create a Samba user: Type the following command to create a Samba user "johndoe":

css
sudo smbpasswd -a johndoe

You will be prompted to enter a password for the new user.

  1. Add the Samba user to the Samba group: Type the following command to add the Samba user "johndoe" to the "smbgrp" group:
sudo usermod -aG smbgrp johndoe
  1. Restart Samba: Type the following command to restart the Samba service:
sudo systemctl restart smbd
  1. Allow Samba through the firewall: If you have a firewall enabled, you will need to allow Samba through it. Type the following command to allow Samba through the firewall:
sudo ufw allow samba

Once you have completed these steps, other computers on the network should be able to access the shared folder using the network path "\Ubuntu-IP-Address\SharedDocs" (replace "Ubuntu-IP-Address" with the IP address of your Ubuntu computer). They will need to enter the Samba username and password that you created to access the shared folder.

Comments

Popular posts from this blog

Office 365: How to force users to change their password /O365

First we will see how to do it for one account then we will see how to do it for multiple accounts. 1. Install Prerequisites:       We will need MSOnline module to connect to Office 365 with PowerShell.         Open a PowerShell prompt with administrator rights : 2. Install MSOnline module :               It will Also install NuGet Provider , accept and yes to continue.   3.Connect to Office 365     Use Connect-MsolService  to open the Microsoft Office 365 sign in window :       Now a Pop Up windows will open For Microsoft Oath2 Security , Name and password of Administrative user or Global admin must be given here for making any changes.     4.Reset user password :           4A.Force new password :                        With this command we can set a password for a...

How to Reset Forgotten Password on Kali Linux

          Kali Linux is a Linux distribution used in the Cybersecurity domain. It is maintained and funded by Offensive Security. Kali Linux is Debian based and it uses the Debian repository for most of its packages. This Linux distribution is designed for digital forensics and penetration testing. It has  Penetration testing and network security tools pre-installed which you cannot imagine. It is completely free and open source. So you can use it for free and even contribute to its development.         Now forgetting login credentials is an annoying thing in the case of any operating system. Resetting forgotten passwords often comes with the risk of data loss and requires a lot of effort if you are not a technology enthusiast. This article will be a simple step-by-step guide on resetting forgotten passwords on Kali Linux. How to Reset Forgotten Password on Kali Linux?           In this section, we will ...

How to create a “Let’s Encrypt” certificate on Windows ,

  Cryptographic certificates are the digital equivalent of website validation, which enables you to encrypt connections using TLS protocol and thus provide a secure link between server and client. There are both paid and free certification centres. Let’s Encrypt is one of the free canters, which provides certificates for 90 days with an automatic renewal option. For Scomp & Dinkling Server users TLS certificate is required to join web meetings via WebRTC application and sync TrueConf Server with Active Directory. Table of Contents Step 1: Getting started. Step 2: Creating a certificate.     Step 1: Getting started. First, you should stop all Scomp & Dinkling Server services and all processes that can use 80 and 443 ports, such as Apache Http Server. To create a TLS certificate on Windows, download the ACME Simple (WACS) program. Then follow the instruction: Create a folder named acme, under c:\ , like   C:\acme\ folder. Extract the do...