Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have got a sub directory of a shared directory that I use Samba with and have set it to be accessible by only one user:

$ cd /mnt/SomeSambaShare 
$ ls -lad SomeDir
drwx--S--- 23 SomeUser SomeGroup 4096 2012-07-26 07:44 SomeDir

I cannot access this directory as a linux user other than SomeUser.

But I still can access this directory using a different Samba user than SomeUser. Why is that? And how do I prevent this?

share|improve this question

closed as too localized by qbi, Eliah Kagan, hhlp, Chris Wilson, Ringtail Jan 18 '13 at 15:04

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Could you provide the relevant lines from your smb.conf? I assume you can do some tweaking there. – qbi Jan 15 '13 at 17:16
This question appears to be abandoned and really unanswered, if you are experiencing a similar issue please ask a new question with details pertaining to your problem. If you feel this question is not abandoned, please flag the question explaining that. – Eliah Kagan Jan 18 '13 at 2:07

Try adding this line in your /etc/samba/smb.conf file and restarting samba.

valid users = SomeUser
share|improve this answer
I don't want to restrict access to the share but to a subdirectory of a share. The share itself is pretty much available to every user on the network. – dummzeuch Sep 18 '12 at 18:15


invalid users = root bin daemon adm sync shutdown \
                    halt mail news uucp operator
auto services = dave peter bob

I would think you could put them in the invalid users list or create an invalid users list in the section you need to restrict.

share|improve this answer

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