5 Minutes on Linux: Unable to remove user shares

Problem: I shared a folder using samba sometime back, the share name I used was “MyDocs”, the user was removed later.  After logging in as a new user, I’m unable to use the share name “MyDocs”.

Challenge: for GUI users, one does not have a facility to unshare or manage the orphan shares.

Solution 1 (to unshare): use the command line:

  1. net usershare list
  2. net usershare delete sharename

Solution 2 (to remove orphan shares):

ls -l /var/lib/samba/usershares

sudo rm /var/lib/samba/usershares/sharename

Once this is done, I was able to reuse the share name again.  However, in the current model, it is clear that the shares with same name (even when share is from  different users) they must all be unique.

This entry was posted in Linux, Open Source, Tips - Tricks and tagged , , . Bookmark the permalink.

Leave a Reply