Sharing a Public Folder on Ubuntu with Windows 11

|

|

The post provides instructions on how to share a user’s Ubuntu Public folder with Windows 11 systems using Samba, an open-source implementation of the SMB/CIFS network protocol. Upon sharing the Public folder, users within the local network can access it. The process involves installing Samba on Ubuntu, enabling guest access and file creation or deletion,…

This post shows students and new users steps to share a user’s public folder on Ubuntu with Windows 11 systems using Samba. Every Ubuntu user home directory has a Public folder in it. The folder is Public and isn’t shared by default. However, you can easily share this folder with others on your local network.

When you share the Public folder, users directly connected to your local network can browse and access it. While sharing it, you can also share so that guests (people without a user account ) can access it.

To share with Windows systems, Samba must be installed. Samba is an open-source implementation of the SMB/CIFS network file-sharing protocol that allows users to access files, printers, and other shared resources.

This post can also apply to other Linux folders you want to share with Windows systems.

Follow the steps below to start sharing the public folder in the Ubuntu user’s directory with Windows.

How to share folders on Ubuntu Linux

You’ll find the Public folder in your home directory when you sign in to your Ubuntu desktop and browse the File Explorer. Everyone account on the Ubuntu system has one. Their folder is there to share with other users, including Windows users.

If you’re using the Ubuntu Linux system and want to share the Public folder in your home directory, simply open the File Explorer, then right-click on the Public folder and select Local Network Share, as highlighted below.

On the folder sharing settings pane, check the “Share this folder” box to share with others.

When you check the box, a pop-up screen will open, prompting you to install a shared folder service. This will install Samba on Ubuntu.

Click the Install service button to continue.

On the next windows, click Install to install Samba.

Next, check the boxes “Allow others to create and delete files in this folder” and “Guest access” if you want to share with other Windows users who should have the rights to create and delete folders.

After that, click the Create Share button to share the folder.

Run the commands below to add your account to the Samba share group on the Ubuntu system. Replace richard with your username.

sudo gpasswd sambashare -a richard

Next, create a Samba password for your account. Replace richard again with your account name.

sudo smbpasswd -a richard

Finally, restart Samba.

sudo systemctl restart smbd.service nmbd.service

How to enable Windows 11 file sharing

Now that the folder is shared on Ubuntu, the first thing you’ll want to do to access Ubuntu shares from Windows is to allow file sharing and network discovery.

To quickly enable File sharing in Windows 11, click on the Start menu, then search for “Command Prompt,” as highlighted below. Then right-click on the Command Prompt apps and select Run as administrator.

When the Command prompt app opens, run the commands below

netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes
netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes

Sometimes, you’ll also want to switch the network profile to Private mode in Windows 11. To do that, click on Start ==> Settings ==> Network & Internet ==> Ethernet and select Private.

Turn on Public Folder Sharing in Windows 11

Use the steps below to set up file sharing.

Windows 11 has a centralized location for the majority of its settings. Everything can be done, from system configurations to creating new users and updating Windows from its System Settings pane.

However, changing the account username is still done in the old Control Panel. To get to Control Panel, you can click on Start and start typing Control Panel as shown in the image below:

In the Control Panel, select Network and Internet, as highlighted in the image below.

Select Network and Sharing Center on the next pane, as highlighted below.

Next, select Change advanced sharing settings as highlighted below.

Select Private (current profile) in the Advanced sharing center and Turn on File and printer sharing.

Save your changes and exit.

On the same Advance sharing options page, scroll down All networks.

You should see settings for Public folder sharing, Media streaming, File sharing connections, and Password protected sharing. Windows should automatically turn on File and printer sharing in private networks. However, in some instances, this will not be enabled.

If you can not automatically find printers and shared resources in your private network, the File sharing option may be disabled.

If you enable password-protected sharing, only people with accounts on the local computer or in the domain environment can access shared files and printers.

Make your changes and save, then exit.

After enabling sharing, browse to the Ubuntu Public folder using the server hostname or IP address. When prompted, type in the Samba account name and Password created above.

You should see the Public folder you shared.

That should do it!

Conclusion:

This post showed you how to share the Ubuntu Public folder with Windows systems. Please use the comment form below if you find any errors above or have something to add.

Like this:



3 responses to “Sharing a Public Folder on Ubuntu with Windows 11”

  1. Andre Avatar
    Andre

    How to see who is currently accessing my files from Ubuntu? What files is being read, how long he has been accessing it or idle? Like the information from Windows’ Computer management – Shared folder.

  2. Paul Avatar
    Paul

    When you say
    “On the Ubuntu system, run the commands below to add your account to Samba share group. Replace richard with your own username.

    sudo gpasswd sambashare -a richard”
    is this the username on Ubuntu? or windows?

    1. Richard Avatar
      Richard

      Samba / Ubuntu account. Works best if Windows and Ubuntu use the same username and password.

Leave a Reply to Richard Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.