Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

getting the following error while running net usershare command. net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error Permission denied You do not have permission to create a usershare. Ask your administrator to grant you permissions to create a share.

How to fix this? Thanks, :)

share|improve this question
add comment

1 Answer 1

The directory /var/lib/samba/usershares is set up so only root or members of the sambashare group can read or write to it.

drwxrwx--T  2 root sambashare  4096 Mar 25  2012 usershares

That you can't access it (try it by cding to it) suggests to me that you're not in the sambashare group. You can test this with id $USER and assuming usershares is not in the output, you can fix all this just by running:

sudo usermod -a -G sambashare $USER

If you still get error 255 after adding the particular user to the group you might need to reboot.

share|improve this answer
    
Found that the directory is present there with a cross mark onto the folder. though i am being able access other folders in the LAN through SAMBA but not able to share my files to others. –  Ashis Sanpui Feb 19 '13 at 6:26
    
this is the error while trying to "Create Share" 'net usershare' returned error 255: net usershare: cannot open usershare directory /var/lib/samba/usershares. Error Permission denied You do not have permission to create a usershare. Ask your administrator to grant you permissions to create a share. –  Ashis Sanpui Feb 19 '13 at 6:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.