I am setting up a samba server on RHEL7. I would like to set up my share permission in the following manner -

Directory shared -


Files in /shared/ -

I want to allow user to access to file1,file2 and private direcotry without allowing them to browse /shared/ directory.

User should not see what is inside /shared/ directory but if they know the exact file and directory name in /shared/, they should be able to access it via full path.

Can it be done?


  • off hand, I seem to think per file/directory permissions (without a forced permissions setting) on samba should do it. – Journeyman Geek Mar 11 '15 at 8:35

You can do that quite easily by removing the "r" permission on /shared/
Something as that: chmod go-r shared

After that command, if the user try do access the /shared/ folder it will be a "access denied" message. But if it explicitly enter a file's complete path (eg: /shared/file1) it can access the file.

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.