Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 08-01-2002, 11:50 AM   #1
LQ Newbie
Registered: Jul 2002
Posts: 1

Rep: Reputation: 0
Question file perm, chgrp, chmod, and umask

I have a web server where I want multiple users to be able to maintain, modify, and create files in the /home/httpd/html dir.

I have made the users members of a new group (web).
I have chgrp -R the dir so that all current files and sub dirs are owned by the web group.

I want the users to show up as the owner (for tracking purposes) and the group to be web on all NEW files and dirs.

Currently they show up as the user for owner, but USER for the group.

I set the GID bit with chmod and now new files do show up as web for the group. Is that the correct way?

2nd question:
Is there any way to set a default umask for a part of the dir structure? Currently the umask is 077 and that means that I have to go in and chmod all the web files so they work on the site. I DO NOT want these users to have to do that.

I could set the default umask to 775, but then ALL files will be created that way.... not good.

Surely there is a way to accomplish this.

Old 08-06-2002, 12:10 PM   #2
Registered: Apr 2002
Location: St. Paul, Minnesota
Distribution: UbuntuStudio, Ubuntu
Posts: 357

Rep: Reputation: 31
1) Yes, that is the right way.

2) I believe most admins use a script that runs from CRON on a nightly or hourly basis.

++ script ++
chgrp -R web /home/httpd/html
chmod -R a+r,ug+w,o-w /home/httpd/html
++ end ++
Old 08-06-2002, 09:04 PM   #3
LQ Addict
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
Regarding point 2: don't try it on old systems (potentially with old fileutils) if a malicious user in the web group creates a symlink to a file, for instance /etc/passwd when this scriipt is running out of cron /etc/passwd file ends up to be in the hands of this user.

Last edited by neo77777; 08-06-2002 at 09:09 PM.


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
Using chown, chgrp, chmod on a vfat partition? Rodolfo Medina Linux - General 7 08-17-2005 09:17 AM
Chmod ,chown ,chgrp commands not working proper---------------- pal Linux - Newbie 12 03-07-2005 10:55 AM
chmod ,chown ,chgrp------------ pal Linux - Newbie 1 02-27-2005 03:49 PM
umask chmod?? blackzone Linux - Newbie 3 01-11-2005 02:50 AM
Problems with chmod and chgrp OC_eobard Linux - Newbie 13 06-08-2004 01:36 AM > Forums > Linux Forums > Linux - Newbie

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

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