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 ?
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 http://centos.org/docs/5/html/Deployment_Guide-en-US/ch-acls.html
Follow the documentation by editing the /etc/fstab and remounting the partition then simply
o for others, u for users.
I recommend you read the docs and do some tests. Hope this helped.
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: