Share hiding depending on login possible with Samba.

Associate
Joined
10 Nov 2004
Posts
2,237
Location
Expat in Singapore
Hi,

As some will already know, I have a PC based NAS which is working great but I have a issue I would like to tune if possible.

I have set up some Samba shares;
backup
kids
movies
music
(for example)

When I connect with my A.C.Ryan HD Mini, it will connect to the NAS box and show all the shares. Only when I try to access a share will it ask for an access password.

What I would like is to have a password to access the NAS box and depending on the login, it will display some shares (i.e. shares available are dependant on the login rather than access to the separate shares are dependant on the separate logins).

What I have;
Connect to NAS
-> Backup
----> Password to access
-> Kids
----> Password to access
-> Movies
----> Password to access
-> Music
----> Password to access

What I would like;
Connect to NAS
--> Password to access
----> User 1
-------> Kids
-------> Music
----> User 2
-------> Kids
-------> Music
-------> Movies
----> User 3
-------> Backup

The idea being that if you do not have the access you cannot see the full list of things available. This is more for it being tidy more than anything else. The A.C.Ryan does not allow you to input a share path by hand so hidden shares would not work (not from the GUI anyway, creating a shortcut on the A.C.Ryan directly saved to the units file system may be possible but haven't tried).

Suggestions / other software recommendations (the A.C.Ryan can use NFS shares but I have some WD Live HD TV units and I don't know if they can).

Thanks
RB
 
use unionfs on User1 with Kids+Music, share the unionfs using samba and only let User1 see it. Same for other users.

Is that the kind of thing that you'd like? Not sure if you can hide shares from some users or if they are always available using samba, but that way users only need one password for all their shares. (ie User1 sees Kids + Music as folders of his user1 share).
 
When you define the share you can put:

Code:
browseable = no

It's not exactly what you want as it won't show the share for any user, however you will be able to map it if you know the share name (obviously you can set up user permissions so only certain users can map the share).
 
You can set Samba to limit access to shares by the user accessing the server. How to do it should be in the Samba documentation.

Have a look at how the valid users field is being used here ... you should be able to have the user to available shares that you want by adding appropriate users as being valid on each share I'd have thought.
 
use unionfs on User1 with Kids+Music, share the unionfs using samba and only let User1 see it. Same for other users.

Is that the kind of thing that you'd like? Not sure if you can hide shares from some users or if they are always available using samba, but that way users only need one password for all their shares. (ie User1 sees Kids + Music as folders of his user1 share).

Thanks, will take a look at that.

When you define the share you can put:

Code:
browseable = no
It's not exactly what you want as it won't show the share for any user, however you will be able to map it if you know the share name (obviously you can set up user permissions so only certain users can map the share).

Problem is that the media player will not allow me to type the path to the share, only allow me to connect to visible shares.

You can set Samba to limit access to shares by the user accessing the server. How to do it should be in the Samba documentation.

Have a look at how the valid users field is being used here ... you should be able to have the user to available shares that you want by adding appropriate users as being valid on each share I'd have thought.

Ok will take a look at this too. The other option I have to look at is automounting the kids&music shares and requiring a login for the other shares. This will stop the kids having the login details for the NAS access at all.

Thanks for the replies.

RB
 
Back
Top Bottom