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 called Public and isn’t shared by default, however, you can easily share this folder to others on your local network.
When you share the Public folder, users that are directly connected to your local network will be able to browse and access it. While sharing it, you can also choose to share so that guest (people without a user account ) can also access it.
In order 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.
To get started with sharing the public folder in Ubuntu user’s directory with Windows, follow the steps below.
How to share folders on Ubuntu Linux
When you sign in to your Ubuntu desktop, and browse the File Explorer, you’ll find Public folder in your home directory. Everyone account on Ubuntu system has one. There folder is there to share with other users, including Windows users.
If you’re using Ubuntu Linux system and you’d 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 box “Share this folder” to share with others.
When you check the box, a pop up screen will open prompting you to install a service in order to share folders. 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 to “Allow others to create and delete files in this folder” and “Guest access” if you want to share other Windows users who should have rights to create and delete folders.
After that, click the Create Share button to share the folder.
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
Next, create a Samba password for your account. Replace richard again with your own 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
In some cases, 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 setup file sharing.
Windows 11 has a centralized location for majority of its settings. From system configurations to creating new users and updating Windows, all can be done from its System Settings pane.
However, change 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.
On the next pane, select Network and Sharing Center as highlighted 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.
Save your changes and exit.
On the same Advance sharing options page, scroll down All networks.
There 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, then File sharing option may be disabled.
If you enable password protected sharing, only people who have accounts on the local computer or in domain environment will be able to 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!
This post showed you how to share Ubuntu Public folder with Windows systems. If you find any error above or have something to add, please use the comment form below.