Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-09-2006, 05:45 PM
|
#1
|
Member
Registered: Sep 2003
Location: Central Coast, California
Posts: 179
Rep:
|
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,
|
|
|
01-09-2006, 06:10 PM
|
#2
|
Member
Registered: Nov 2004
Distribution: Slackware 11, Ubuntu 6.06 LTS
Posts: 700
Rep:
|
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 
|
|
|
01-10-2006, 01:02 AM
|
#3
|
Member
Registered: Aug 2004
Location: India
Distribution: Redhat 9.0,FC3,FC5,FC10
Posts: 257
Rep:
|
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
|
|
|
01-14-2006, 09:19 PM
|
#4
|
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552
Rep:
|
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.
|
|
|
01-14-2006, 11:41 PM
|
#5
|
Member
Registered: Jun 2005
Posts: 73
Rep:
|
chmod -R 1755 /home/<user_name>
try this, if it cause some error, change it back.
|
|
|
01-15-2006, 10:33 AM
|
#6
|
Moderator
Registered: May 2001
Posts: 29,417
|
Stickman's umask hint is OK. Just don't follow llmmix' advice: that's nice, but IT'S WRONG.
|
|
|
01-15-2006, 10:26 PM
|
#7
|
Senior Member
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549
Rep:
|
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.
|
|
|
01-16-2006, 09:19 PM
|
#8
|
Senior Member
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552
Rep:
|
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.
|
|
|
01-16-2006, 09:36 PM
|
#9
|
Senior Member
Registered: Aug 2004
Location: Munich, Germany
Distribution: Opensuse 11.2
Posts: 1,549
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 01:59 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|