File sharing in Ubuntu is essential for IT professionals managing networks, enabling seamless accessibility across different devices and operating systems. It is particularly useful in collaborative environments where users need to access and modify files on a central system. By configuring appropriate permissions, administrators can control access to shared resources, ensuring security and compliance with organizational policies.

The implementation of shared folders in Ubuntu relies on Samba, a free software re-implementation of the SMB/CIFS networking protocol. Samba allows for interoperability between Linux/Unix servers and Windows-based clients, making it a versatile tool for heterogeneous network environments. This capability is especially beneficial in mixed-OS networks where file sharing needs to be efficient and seamless.

Setting up shared folders in Ubuntu can be done through the command line or a graphical user interface (GUI). The command line provides granular control over the shared resources, while the Files file manager application offers a more user-friendly approach. Both methods ensure that shared resources are accessible over the network, providing flexibility based on the user's preference and technical expertise.

Steps to share folders via Samba or SMB on Ubuntu Desktop:

  1. Open Files.
  2. Right-click on the folder you want to share and click on Local Network Share.
  3. Click on the Share this folder checkbox in the folder sharing window.
  4. Click on Install service button on the Sharing service is not installed alert window if you never installed the required service before.

    This will install Samba and other related packages.

  5. Click on the Install button on the Install additional software? window.

    Click on the Description to view more details about the packages to be installed

  6. Enter your password and click on the Authenticate button on the Authentication Required window.

    Your account must have administrator privilege to be able to proceed.

  7. Wait for the installation to finish.
  8. Select other options if necessary and click on Create Share.
  9. Shared folder will now have a sharing icon.
  10. Allow network ports for Samba at the terminal.
    $ sudo ufw allow samba
    [sudo] password for user: 
    Rules updated
    Rules updated (v6)

    This is only required if you've enabled firewall. It is disabled by default.

  11. Test network folder access from a remote machine.

This guide is tested on Ubuntu:

Version Code Name
22.04 LTS Jammy Jellyfish
23.10 Mantic Minotaur
24.04 LTS Noble Numbat
Discuss the article:

Comment anonymously. Login not required.