In Ubuntu this worked out of the box, in LMDE I received an error upon clicking "Create Share" that went something like this.
Code: Select all
'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.
First, I checked to make sure I actually had the directory mentioned.
Code: Select all
sudo su
Code: Select all
cd /var/lib/samba/usershares/
Code: Select all
exit
Code: Select all
chown root:sambashare on the /var/lib/samba/usershare
Since I was trying this as a user I edited it, and in place of root I put my username so that it read
Code: Select all
sudo chown dave:sambashare var/lib/samba/usershare
If I understand correctly this sets you as the owner and sambashare as the group of /var/lib/samba/usershare
This needed to be run with root privileges so it might be necessary to add a 'sudo' in front of it for you as it was for me.
Following this step I was able to successfully create the share and view it on my Windows box, however, I was not able to get in as it said I had the wrong password.
To fix this I used 'smbpasswd'. From their man page:
Running plain old smbpasswd in terminal asks you for your Old password which, of course, I did not know. Run with the -a switch smbpasswd adds the username to the local smbpasswd file. If the user already exists in that file then the command is treated as a regular request to change the password. Note: this requires sudo in front of it, as I have done, or else it will fail as noted in the man pages.The smbpasswd program has several different functions, depending on
whether it is run by the root user or not. When run as a normal user it
allows the user to change the password used for their SMB sessions on
any machines that store SMB passwords.
Code: Select all
sudo smbpasswd -a dave
Enter your new password twice and you should be all set!
Notes, please read.
Following this I was successfully able to browse my home directory, not just the "Public" directory as I originally requested. I'm unsure of why it didn't. Perhaps (and this is only a guess) Samba had shared my home directory by default and changing the password as we just did above allowed me to access it. The first part of this guide, chowning /var/lib/samba/usershares, may actually be completely unnecessary if you can view your machine in network locations but just cannot access it. As I said though, for me this works perfectly.
I hope this helps someone setup sharing quickly and easily. Tips, suggestions on how to make this more secure or better are of course welcome. I'm no master here by any means, however, this got me up and sharing without breaking anything so I deem it a success!