How to *STOP* sharing a folder

To share a folder on my Local Area Network, I used these instructions, and just had to click the box saying "Share this folder". Great.

Then I changed my mind, so I thought in order to UNDO that, I just needed to un-tick the box. Nope. Because now that I've installed Samba, the box doesn't exist anymore. Instead of the "Local Network Share" tab, there are tabs for "Permissions", "Notes", "Access Control List", "Extended User attributes". A whole bunch of really complicated stuff, and nowhere is there any box to just say "DON'T share this folder anymore".

Theoretically, I could just change permissions, but that's missing the point. Somewhere, a setting has been saved that says "This is a folder I want to share". Where is it, and how do I undo that?


Solution 1:

You should read all the answers here:

  • How do I completely remove Samba?

But the solution which seems best is:

sudo apt -y remove --purge samba samba-common cifs-utils smbclient
sudo rm -rf /var/cache/samba /etc/samba /run/samba /var/lib/samba /var/log/samba

If you want to keep samba and only one to uncheck a specific folder see this:

  • How to remove/disable sharing of single folder [SOLVED]

The share definitions are in /var/lib/samba/usershares. Open it (as root if necessary) and remove the definition files.

Solution 2:

in Nautilus Right Click on the Shared Folder. Select Permissions. Select 'Local Network Share' Tab. Uncheck 'Share this Folder'. Click 'Modify Share' button.