LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-06-2009, 10:46 AM   #1
johngoodin
LQ Newbie
 
Registered: Oct 2009
Posts: 8

Rep: Reputation: 0
How can I make my Home directory invisible to others?


How can I make my Home directory invisible to others?

I have two accounts on my system and my Home Directory can be accessed from the other account via Storage Media - User Accounts. Is there a way to remove User Accounts from Storage Media? Better yet is there a way to fix it that users only see their own Home and no other?
 
Old 10-06-2009, 11:05 AM   #2
vinaytp
Member
 
Registered: Apr 2009
Location: Bengaluru, India
Distribution: RHEL 5.4, 6.0, Ubuntu 10.04
Posts: 704

Rep: Reputation: 55
Quote:
Originally Posted by johngoodin View Post
How can I make my Home directory invisible to others?

I have two accounts on my system and my Home Directory can be accessed from the other account via Storage Media - User Accounts. Is there a way to remove User Accounts from Storage Media? Better yet is there a way to fix it that users only see their own Home and no other?
Hi Johngoodin,

You can do one thing change your username like this

usermod -l .johngoodin johngoodin

This will make your home directory invisible..
 
Old 10-06-2009, 11:14 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by vinaytp View Post
Hi Johngoodin,

You can do one thing change your username like this

usermod -l .johngoodin johngoodin

This will make your home directory invisible..
AIUI this only changes the user name, not the home directory name. Changing the home directory name to /home/.johngoodin would not make it invisible, it would only make it hidden and users can easily see hidden directories. AFAIK, the only way to make a a user's home directory invisible to other users is to put it inside another directory that only the user has read and execute permissions for. Other users could still see that directory but they could not seethe home directory inside it.

Last edited by catkin; 10-06-2009 at 11:16 AM. Reason: Convert gobbledygook to sense
 
Old 10-06-2009, 11:41 AM   #4
johngoodin
LQ Newbie
 
Registered: Oct 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by catkin View Post
AIUI this only changes the user name, not the home directory name. Changing the home directory name to /home/.johngoodin would not make it invisible, it would only make it hidden and users can easily see hidden directories. AFAIK, the only way to make a a user's home directory invisible to other users is to put it inside another directory that only the user has read and execute permissions for. Other users could still see that directory but they could not seethe home directory inside it.
Think I got the solution.

I opened my Home in Konqueror and right clicked Home in the folder pane.
Then clicked Properties - Permissions

And set Group & Others to Forbidden. It's my understanding now only I or a Root Shell in Terminal can read or write to it.
 
Old 10-06-2009, 12:12 PM   #5
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by johngoodin View Post
Think I got the solution.

I opened my Home in Konqueror and right clicked Home in the folder pane.
Then clicked Properties - Permissions

And set Group & Others to Forbidden. It's my understanding now only I or a Root Shell in Terminal can read or write to it.
That sounds right. Here is another way to do this using the shell. When you list a directory's contents --

Code:
$ ls -la
-- part of the listing for each directory entry looks like this:

rwxr-xr-x

Or something similar. Now enter this:

Code:
$ ls -la /home
You will see a list of each user's directory, accompanied by the "permissions" as above. The permissions field is broken up into three subfields for (u)ser, (g)roup and (o)thers:

uuugggooo
rwxr-xr-x


The user permissions are for the the owner of the account. The group permissions for for any member of the same group as the user. "Other" permissions are for anyone else.

So, to protect your home directory from prying eyes, it is not enough to deny access to "other" but to "group" also. Like this:

Code:
$ chmod go-rwx
Translated, this means "deny read, write, and explore access to any members of the group I belong to and all others."

The directory listing you want for maximum privacy (from all but root) is this:

username rwx------

One more detail. For a file, the "x" permission grants the right to execute it. For a directory, the "x" permission grants the right to explore it.
 
Old 10-06-2009, 07:33 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
As per catkin
Quote:
-l, --login NEW_LOGIN
The name of the user will be changed from LOGIN to NEW_LOGIN. Nothing else is changed. (!) In particular, the user's home directory name should probably be changed to reflect the new login name.
http://linux.die.net/man/8/usermod
(my exclamation mark)
 
Old 10-07-2009, 04:42 AM   #7
AngTheo789
Member
 
Registered: Sep 2009
Posts: 110

Rep: Reputation: 24
Put your confidential directories or your whole home directory on a drive or partition that is not mounted by default (you then need to make your entry in the /home directory a softlink to the real location, whether it's mounted or not). That way you absolutely lock out people, except those who have mount permissions.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Make FTP user and specify directory outside home mirror51 Linux - Newbie 4 09-21-2009 01:19 AM
Make home directory private to other users wilberto83cg Linux - Software 4 08-22-2006 11:27 AM
Can't make dir in home directory! lennoguard Solaris / OpenSolaris 18 02-25-2006 08:23 AM
How do you install a new hard drive and make it the new /home directory??? anilnatha Linux - Hardware 4 08-02-2005 05:39 PM
How to make My Documents my home directory foxy123 SUSE / openSUSE 6 12-29-2004 03:49 PM


All times are GMT -5. The time now is 07:07 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration