Create Samba Shares Directly from Thunar
Once upon a time Thunar had a plugin called thunar-shares-plugin which resembled nautilus-shares in Gnome allowing the user to create samba usershares directly from Thunar itself without using any other utility. Thunar-shares-plugin is broke. It's not offered in Xubuntu because it's broke but it is available in Debian presumably because they don't know it's broke. This is my feeble attempt to bring some of that functionality back to Thunar using "User Custom Actions".
Note: To those who are unfamiliar with this type of share it's what Samba refers to as a "Usershare". It's designed to allow any user to create a samba share of any folder he owns without becoming root. The share definition it creates is not in /etc/samba/smb.conf like Classic- shares but in /var/lib/samba/usershares. For more on userhsares: http://forums.linuxmint.com/viewtopic.php?f=42&t=23169
Remember folks Mint no longer installs the samba server package by default so you need to do that first:
Code: Select all
sudo apt-get install samba --install-recommends
Open Thunar and Select Edit > Configure Custom Actions > +
Basic Tab:
Name: Samba Public Read Only
Command:
Code: Select all
net usershare add %n %f "" Everyone:R guest_ok=y
Make sure only Directories is enabled.
Restart Thunar and right click a directory in your home folder, say Documents, and select "Samba Public Read Only". To check if it has done it correctly run the following command to see the share definition:
Code: Select all
net usershare info --long
I will list all the possible permutations here. Just use the same procedure as outlined above:[documents]
path=/home/altair/Documents
comment=
usershare_acl=Everyone:R,
guest_ok=y
Samba Public Read Only
Code: Select all
net usershare add %n %f "" Everyone:R guest_ok=y
Code: Select all
net usershare add %n %f "" Everyone:F guest_ok=y && chmod 777 %f
Code: Select all
net usershare add %n %f "" Everyone:R guest_ok=n
Code: Select all
net usershare add %n %f "" Everyone:F guest_ok=n && chmod 777 %f
Code: Select all
net usershare delete %n && chmod 755 %f
What it can do:
Create a samba usershare.
Change permissions on the target folder allowing write access to samba clients.
What it can't do:
Nautilus-shares and Thunar-shares had a GUI which showed you available options and those you have already selected.
Nautilus-shares but not Thunar-shares changed the folder icon to show you that the folder was shared.