Server Fault is a question and answer site for system and network administrators. 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

How can I restrict user to read other users directory in linux ?

for instance I have user1 and user2, I dont want the user2 to read /home/user1/... How can I do this ?


share|improve this question

Like zed said but you probably have service running which mean that it if you do this, these services will not be able to read theses files either if the service doesn't run under the user permission, which is rarely the case, most service runs under their own users.

ACL (Access control list) are what you may need. Here is the official doc

Follow the documentation by editing the /etc/fstab and remounting the partition then simply

setfacl -m d:o:--- /home/user1/
setfacl -m d:u:rwx /home/user1/

o for others, u for users.
Now retreive the acl :

getfacl /home/user1/

I recommend you read the docs and do some tests. Hope this helped.

share|improve this answer
acls! how good.. I can't believe I've been using CentOS for years with just perms and groups.. /me headdesk in a good way! – Grizly Apr 7 '10 at 23:19

chmod 700 /home/user1

This assumes that ownerships are set correctly, of course, and that you aren't needing something like a webserver to be able to see files in a public_html directory.

If you want to restrict listing files in a directory, without removing the ability to read specific files or subdirectories with known names and appropriate permissions, use: chmod 711 /home/user1

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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