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 01-09-2006, 05:45 PM   #1
psychobyte
Member
 
Registered: Sep 2003
Location: Central Coast, California
Posts: 179

Rep: Reputation: 30
home directories created w/ 755 permissions


Hi,

I had a custom install of Fedora Core 4 on a couple of machines. I noticed that the permissions on the home directories have permissions set as 755 on every home directory.

This allows other users to peek into other user's home directores. Where do I change the default permissions set on home directories when they are created?

This shouldn't be a default config for a linux box. Was there something that I missed during the initial install?

Thanks,
 
Old 01-09-2006, 06:10 PM   #2
J_K9
Member
 
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700

Rep: Reputation: 30
Hi psychobyte,

It would help if you filled in the "Distribution" section of your profile - that way we would know what distribution you are using.

I am afraid that, because all distros are different and run different Window Managers, I don't have a clue how to set home directories to have certain perms when they are created.

You can, however, do a "chmod 700 /home/user" on each home directory - that would work. I'm not sure if doing a "chmod 700 /home" would solve your problem?

Cheers,

-jk
 
Old 01-10-2006, 01:02 AM   #3
live_dont_exist
Member
 
Registered: Aug 2004
Location: India
Distribution: Redhat 9.0,FC3,FC5,FC10
Posts: 257

Rep: Reputation: 30
As J_K9 says..u can run chmod ..a recursive chmod could be something like chmod -R 700 /home but this shouldnt be the ideal way .Whenever the profile files are copied into the users home directory you should add a line to the script which says chmod -R /home/username so you dont have to do it manually each time.

To find out all the directories that currently have permissions as 755 you should use the find call.Read up on the man for the syntax...coz I have trouble remmebering it

shd be something like find /home -perm 755 -print

Cheers
Arvind
 
Old 01-14-2006, 09:19 PM   #4
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
If you "chmod -R 700 /home" then most likely the only user to access this directory will be root since the ownership is probably root:root. You could change the individual user directories though. As far as setting the default permissions, read up on umask.
 
Old 01-14-2006, 11:41 PM   #5
llmmix
Member
 
Registered: Jun 2005
Posts: 73

Rep: Reputation: 15
chmod -R 1755 /home/<user_name>

try this, if it cause some error, change it back.
 
Old 01-15-2006, 10:33 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Stickman's umask hint is OK. Just don't follow llmmix' advice: that's nice, but IT'S WRONG.
 
Old 01-15-2006, 10:26 PM   #7
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Quote:
As far as setting the default permissions, read up on umask.
But umask only affects the permissions of files and folders created by the user after they've been created doesn't it? For example I just did a test on my Centos4 machine here doing a simple 'useradd test'. It created /home/test with 700 permissions. My root umask is 0022.

I'd be very interested to know where useradd decides what perms to apply to the newly created home dirs.
 
Old 01-16-2006, 09:19 PM   #8
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Useradd is not a good test. Use mkdir or touch instead. umask is the permission template for new files and directories. A umask of 022 should give you a 755 directory or 644 file.
 
Old 01-16-2006, 09:36 PM   #9
tkedwards
Senior Member
 
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549

Rep: Reputation: 52
Yeah my umask is correct, but what I was asking is what does useradd use to set the permissions on the home directory? AFAICT It doesn't look like its root's umask so it must be something else.
 
  


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
How can I change the directory I am currently in and all directories under it to 755? abefroman Programming 6 10-21-2005 06:15 PM
755 permissions via samba for a CDrom or DVDrom... howto in debian? Lleb_KCir Linux - General 1 03-13-2005 12:39 PM
home directories permissions black_man Debian 1 11-20-2004 09:48 AM
how are home directories created waynevnc Debian 3 07-02-2004 08:39 AM
permissions home directories powadha Debian 6 06-11-2004 11:45 AM

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

All times are GMT -5. The time now is 02:19 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
Open Source Consulting | Domain Registration