In this post, we’ll look at how to use Samba to share a user’s public folder on Ubuntu with Windows 11 systems. A Public folder exists in every Ubuntu user’s home directory. The Public folder isn’t shared by default, but you can easily share it with others on your local network.
Users who are directly connected to your local network will be able to browse and access the Public folder if you share it. You can choose to share it with guests (people who do not have a user account) while sharing it.
Samba must be installed in order to share with Windows systems. Samba is a free and open source implementation of the SMB/CIFS network file sharing protocol, which allows users to share files, printers, and other resources. Follow the steps below to begin sharing the public folder in your 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. On the Ubuntu system, each account has one. It is possible to share this folder with other users, including Windows users.
If you’re using an Ubuntu Linux system and want to share the Public folder in your home directory, open File Explorer, then right-click on it and select Local Network Share, as shown below.

To share a folder with others, check the box “Share this folder” in the folder sharing settings pane.

When you check the box, a pop-up window will appear, requesting that you install a service to share folders. On Ubuntu, this will install Samba. To continue, click the Install service button.

On the next windows, click Install to install Samba.

If you want to share folder creation and deletion rights with other Windows users, check the boxes for “Allow others to create and delete files in this folder” and “Guest access.”
Then, to share the folder, click the Create Share button.

To add your account to the Samba share group on an Ubuntu system, run the commands below. Substitute your own username for theexpertcrew.
sudo gpasswd sambashare -a theexpertcrew
Next, create a Samba password for your account. Replace theexpertcrew again with your own account name.
sudo smbpasswd -a theexpertcrew
Finally, restart Samba.
sudo systemctl restart smbd.service nmbd.service
How to enable Windows 11 file sharing
After you’ve shared the folder on Ubuntu, the first step in using Windows to access Ubuntu shares is to enable file sharing and network discovery.
To quickly enable file sharing in Windows 11, go to the Start menu and type “Command Prompt” into the search box, as shown below. Then right-click the Command Prompt apps and choose Run as administrator from the context menu.
Run the commands listed below once the command prompt app has opened.
netsh advfirewall firewall set rule group="File and Printer Sharing" new enable=Yes netsh advfirewall firewall set rule group="Network Discovery" new enable=Yes
In some cases, you’ll also want to change the network profile in Windows 11 to Private mode. To do so, go to Start > Settings > Network & internet > Ethernet > Private and select it.

Turn on Public Folder Sharing in Windows 11
To set up file sharing, follow the steps below.
The majority of Windows 11’s settings can be found in one place. Everything can be done from the System Settings pane, including system configurations, new user creation, and Windows updates.
However, the old Control Panel still allows you to change your account username. To get to Control Panel, go to Start and type Control Panel into the search box, as shown in the image below:
Select Network and Internet from the Control Panel, as shown in the image below.
Select Network and Sharing Center in the next pane, as shown below.

Next, select Change advanced sharing settings as highlighted below.

In the Advanced sharing center, select the Private (current profile) and Turn on file and printer sharing.

Exit after saving your changes.
Scroll down to All networks on the same Advance sharing options page.
Settings for Public folder sharing, Media streaming, File sharing connections, and Password protected sharing should all be available there. In private networks, Windows should automatically enable file and printer sharing. In some cases, however, this will not be possible.
If your private network’s printers and shared resources aren’t automatically discovered, the File sharing option may be disabled.
Only people with accounts on the local computer or in a domain environment will be able to access shared files and printers if password protected sharing is enabled.

Make your changes, save them, and then exit the program.
Navigate to the Ubuntu Public folder using the server’s hostname or IP address after sharing has been enabled. Fill in the Samba account name and password you created earlier when prompted.
You should now be able to see the Public folder that you shared.
No Responses