So I have a bunch of Windows machines, a router running Tomato Firmware v1.28.7500 MIPSR2Toastman-RT K26 USB Ext, and a spare 2TB drive.
I want some folders on the drive to be public (full access to anyone on the network), and some to be restricted to certain users.
Setting up a public share was amazingly easy:
Disable Auto-share all USB partitions, and add the public folder as an Additional Share.
Works great (thank you Toastman, et al)!
But I cannot for the life of me figure out how to share other folders so they are visible to, and accessible by, only certain users.
The best I've come up with is an ungainly way to give permissions to specific machines (not users).
1) Is there a way to do this per user instead of per machine?
2) Is there a better way to do what I'm trying to do?
Here's what I've ended up with:
The 'privileged' machines have to have static ipaddresses assigned (aargh!)
Then I can set up Samba shares with the following custom configuration:
# Allow browse + access for specific ip addresses via include files # named -- [ipaddress].conf containing # browseable = yes ; hosts allow = ALL [NAS_Root] path = /tmp/mnt/foo_drive writable = yes browseable = no hosts deny = ALL EXCEPT 127.0.0.1 include = /tmp/mnt/foo_drive/samba/ipallowshare/root/%I.conf force user = root [PrivateShare] path = /tmp/mnt/foo_drive/private_folder writable = yes browseable = no hosts deny = ALL EXCEPT 127.0.0.1 include = /tmp/mnt/foo_drive/samba/ipallowshare/private_folder/%I.conf force user = root
Then for each private share create a directory (e.g. samba/ipallowshare/private_folder) containing a text file for each ip address that has permission to access the shared folder.
Thus a bunch of identical text files named something like 192.168.1.155.conf, each containing this:
hosts allow = 192.168.1. browseable = yes
It works, but it's per machine, not per user, and between making static ips and corresponding .conf files, it's pretty awkward to maintain.
(Aside … the samba variable %u does not work with include statements, that much I figured out)