LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-07-2006, 09:13 AM   #1
krivenok
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Rep: Reputation: 0
How to hide content of /home directory?


Hello All!

Is there a way to hide inaccessible content of /home
directory?

For example:
# root is root
server@root# ls /home
user1 user2 user3

# user1 should see only user1 subdirectory
server@user1$ ls /home
user1

# user2 should see only user2 subdirectory
server@user2$ ls /home
user2

# user3 should see only user3 subdirectory
server@user3$ ls /home
user3

Is it possible?
Thanks!
 
Old 09-07-2006, 09:21 AM   #2
saini_mw
Member
 
Registered: Jun 2005
Location: On the top of the World
Posts: 114

Rep: Reputation: 15
You can aplly "STICKY BIT" on your /home..

it will solve your problem...

Regards,

Harinder Singh
 
Old 09-07-2006, 10:50 AM   #3
krivenok
LQ Newbie
 
Registered: Jul 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by saini_mw
You can aplly "STICKY BIT" on your /home..

it will solve your problem...

Regards,

Harinder Singh
How can it solve my problem?
 
Old 09-09-2006, 06:55 PM   #4
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
i'm not sure how the sticky bit relates to any of this...

maybe saini_mw misunderstood your question...

i think you'd need to patch your kernel with something like this:

http://www.gobolinux.org/?page=doc/articles/gobohide

http://wiki.linuxquestions.org/wiki/GoboHide

just my ...
 
Old 09-14-2006, 08:53 PM   #5
JrLz
Member
 
Registered: Mar 2004
Location: Jakarta
Posts: 164

Rep: Reputation: 30
u can deny rwx for groups and others, so only the user / owner of that home dir can read it
 
Old 09-14-2006, 09:57 PM   #6
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Set your /home directory as follows:
Code:
root> ls -ld /home
drwx--x--- 12 root users 1024 Sep 13 18:48 /home
Additionally I create a group for each user. So if I have an user account named melvin then I also create a group named melvin. Then the melvin account belongs to the melvin group.
Code:
root> groups melvin
melvin : users lp melvin
Then the /home/melvin directory is owned by melvin:melvin.
Code:
root> ls -ld /home/melvin
drwx------ 22 melvin melvin 2048 Sep 13 18:58 /home/melvin
As this relates to your initial post, the users will not be able to see the contents of the /home directory at all so this doesn't exactly match your stated requirement.
Code:
melvin> ls /home
/bin/ls: /home: Permission denied
But it keeps users from browsing the /home directory and it keeps the updatedb cron job, running under the nobody account, from indexing user files.

Last edited by stress_junkie; 09-14-2006 at 10:26 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Hide and Go Seek with Writer Content LXer Syndicated Linux News 0 05-20-2006 07:54 PM
interactive show/hide content 0raven0 Programming 0 01-15-2006 08:00 PM
Fully hide directory from share Worstje Linux - Software 1 09-18-2004 11:09 AM
How to hide and block a directory for a specific user hoolie_v Linux - Newbie 2 08-08-2004 07:14 AM
How could i hide some files in the share directory(samba) whepin Linux - General 1 12-20-2001 07:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration