LinuxQuestions.org
Review your favorite Linux distribution.
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 03-26-2011, 07:37 PM   #1
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Rep: Reputation: 30
Users can access each others files, :( how to stop that?


I just realized that I can access other users files and they can access my files

simply by using the console to navigate the file system, Its not that big a

deal, I am the only one using the computer but this seems like something is not

configured correctly. Should each user be able to look at and modify each others

files by default? (On Xubuntu 10)

How would I go about restricting users access to other users?

Thanks.
 
Old 03-26-2011, 07:50 PM   #2
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
Check the permissions on the home directories of the users as follows.
Code:
ls -lh /home
It should look something like this.
Code:
$ ls -lh /home
total 76K
drwxr-x---  3 abc       abc       4.0K 2011-01-19 16:43 abc
drwxr-x---  5 folding   users     4.0K 2011-03-26 20:18 folding
drwx------  2 root      root       16K 2010-10-02 17:20 lost+found
In this example there is a user account named abc which can only be accessed by the abc account and root. Then there is a user account named folding for running Folding At Home software. This account's files can be viewed by any user account in the "users" group. Lastly there is the lost+found directory that can only be viewed by root.

Last edited by stress_junkie; 03-26-2011 at 07:53 PM.
 
Old 03-26-2011, 08:13 PM   #3
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Original Poster
Rep: Reputation: 30
Mine shows this:

drwxr-xr-x 66 steve steve 1.0K 2011-01-12 13:07 steve
drwxr-xr-x 22 chair chair 2.0K 2011-01-12 12:30 chair

Should I use chmod to alter the permissions or is there another way I should do it?

Last edited by M$ISBS; 03-26-2011 at 08:13 PM. Reason: Corrected spelling
 
Old 03-26-2011, 08:15 PM   #4
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
Quote:
Originally Posted by M$ISBS View Post
Should I use chmod to alter the permissions or is there another way I should do it?
Yes and yes. Use chmod and there is another way. (Nautilus for example).
 
Old 03-26-2011, 08:24 PM   #5
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by stress_junkie View Post
Yes and yes. Use chmod and there is another way. (Nautilus for example).
Do I issue chmod -rwx for each user? Wouldnt that prevent me from logging into them? I am not sure how to do it
 
Old 03-26-2011, 08:51 PM   #6
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
Just verify that all the directories in /home are actually home
directories for users. Sometimes people or programs will create
directories in /home that aren't real users' home directories.

If there are no special directories, you can run "chmod go-rwx /home/*".
Otherwise it would be "chmod go-rwx /home/user1 /home/user2 ..."

Incidentally, it's good that you noticed simply running "chmod -rwx"
could have been a problem.
 
Old 03-26-2011, 10:04 PM   #7
M$ISBS
Member
 
Registered: Aug 2003
Posts: 834

Original Poster
Rep: Reputation: 30
Thanks guys, I think its ok now.
when I try to access the other user now I get a permission denied message.
 
Old 03-29-2011, 08:23 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
You'll also need to look at umask http://linux.die.net/man/1/umask for newly created files. chmod only affects extant files.
 
  


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
[SOLVED] how to stop other users from viewing my files. lemon09 Linux - Security 6 12-23-2009 05:03 PM
Hide files users do not have access to vonedaddy Linux - Newbie 5 01-05-2008 02:29 AM
Multiple users need to access files stpierrc Debian 2 12-25-2005 05:58 PM
Howto stop users creating certain files kinasz Linux - Security 4 05-06-2004 02:13 AM
how to stop users on the system from access /etc /var /bin /boot ... etc... artistik Linux - Security 11 12-01-2003 06:42 PM

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

All times are GMT -5. The time now is 01:18 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