LinuxQuestions.org
Visit Jeremy's Blog.
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 08-01-2002, 10:50 AM   #1
Martini
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.

Martini
 
Old 08-06-2002, 11:10 AM   #2
GAVollink
Member
 
Registered: Apr 2002
Location: Bronx, NY
Distribution: Ubuntu
Posts: 371

Rep: Reputation: 34
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, 08:04 PM   #3
neo77777
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 08:09 PM.
 
  


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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