I have a Ubuntu machine with the following folders.

enter image description here

I am using samba server to share the folder.

I have 3users:

user 1 = full access
user 2 = access to folder music (only read)
user 3 = access to folder school (only read)

I want to be prompted to log in when you try to access the folder Shared. If user 1 sings in he gets to view all the folders. If user 2 signs in he only gets to see the folder music. And if user 3 sings in he only can see the folder school.

So the idea is to hide folders for users that are not allowed to see those. How can you configure this using samba server.

EDIT: If they can't read the content of the folders it's also okay, if hiding folders isn't possible or harder to do.

Thank you for helping!

If you need more info please ask.


The easiest way would be to create a Linux user account for your 3 users and just have them to sign in to one big shared folder. To do so you will first have to install the gnome system tools with the following command

  sudo apt-get install gnome-system-tools

After you did this go to your user accounts and click the lock button and add your accounts.

Now open the gnome tool we just installed, it’s called users and groups.

Click on an account, select advanced and enter your pass. Go straight to the advanced tab and change shell to /bin/false. Also it’s recommended to generate a random password for the samba accounts so you can’t sign in to them on the Linux machine.

You can also change the user ID to a number lower as 1000 This way it will hide the account on your Linux machine. I recommend you to do this after you are sure everything is working 100%

Now do the same for the other account.

Change Advanced User Settings

After that you make 3 samba accounts and link them to the Linux user accounts. Like shown in the following image:

Samba Server Configuration

Now it’s just a matter of changing permissions on the folders. I will use the student and school folder as an example.

Open an terminal and enter the following command

 gksudo nautilus

enter your password and click okay. Now browse to your shared folder and go to the folder school, right click on it and go to properties, select permissions.

Now you can set properties for users and groups to allow them to enter folders. In this example we want the owner to have full control and the student to only access the files and others get no access. So you would get this:

School Properties

Now it is just a matter of repeating the previous steps to give the other accounts the wanted access and permissions.

I hope this answered your question.

  • 1
    That's exactly the way I did it :) Thank you anyway – Bram Oct 2 '14 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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