I was trying to share my files and folders over the network using Samba, which is what Ubuntu uses, and was getting the following message,
ubuntu ‘net usershare’ returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error Permission denied
so here is what I did to make it work.
1. Open a Terminal and type the following in
sudo gedit /etc/samba/smb.conf
What this will do is open the configuration file for Samba with “Root” privileges which means we can edit it.
2. Find the section called “Global Settings”, which for me was the first section, and paste the following line at the end of the section,
usershare owner only = False
Save the file and close it. Now your sharing should work. If not you may need to log out and log back in or reboot.
Also make sure that your User has the permissions to share files and folders over the network.
To make sure of this go to System > Administration > Users and Groups. Then click the “Unlock” button and enter your password. Click on your user and then on Properties and then go to the User Privileges tab and make sure that “Share files with the local network” is ticked.