public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
* RE: Setting quota on user's home folders?
@ 2005-03-23 20:28 Jessica_Schieffer
  2005-03-28 21:02 ` Simple script to set permissions on folders daily - write script and cron it? Eve Atley
  0 siblings, 1 reply; 15+ messages in thread
From: Jessica_Schieffer @ 2005-03-23 20:28 UTC (permalink / raw)
  To: eatley, peterg, ray; +Cc: linux-newbie

Quotas are supported by default in the RH kernels.  Here is the step by
step from RH site.
http://www.redhat.com/docs/manuals/linux/RHL-8.0-Manual/admin-primer/s1-
storage-quotas.html If you are using ext2, you must enable journaling
first since it is not default until ext3.  Steps to create disk quotas

In order to use disk quotas, you must first enable them. 
1. Modifying /etc/fstab
2. Remounting the file system(s)
3. Running quotacheck (quotacheck -avug)
4. Assigning quotas (edquota)

Example /etc/fstab
/dev/md0          /                  ext3    defaults        1 1
LABEL=/boot       /boot              ext3    defaults        1 2
none              /dev/pts           devpts  gid=5,mode=620  0 0
LABEL=/home       /home              ext3    defaults,usrquota,grpquota
1 2
none              /proc              proc    defaults        0 0
none              /dev/shm           tmpfs   defaults        0 0
/dev/md1          swap               swap    defaults        0 0

Example edquota
Disk quotas for user ed (uid 500):
  Filesystem      blocks       soft       hard     inodes     soft
hard
  /dev/md3       6617996    6900000    7000000      17397        0
0


Jessica Schieffer 
* (201) 248-3566

-----Original Message-----
From: linux-newbie-owner@vger.kernel.org
[mailto:linux-newbie-owner@vger.kernel.org] On Behalf Of Eve Atley
Sent: Thursday, March 17, 2005 2:01 PM
To: 'Peter'; 'Ray Olszewski'
Cc: linux-newbie@vger.kernel.org
Subject: RE: Setting quota on user's home folders?


Sorry about not including system info: it's RedHat 9 ATM (to upgrade to
RH
Enterprise 3).

>I noticed, on running ` locate quota` , that these lines appear in my
output

I ran this too, and it came back with this:

(truncated)
 /etc/warnquota.conf
/usr/bin/quota
/usr/sbin/edquota
/usr/sbin/quotastats
/usr/sbin/repquota
/usr/sbin/rpc.rquotad
/usr/sbin/setquota
/usr/sbin/warnquota
/sbin/convertquota
/sbin/quotacheck
/sbin/quotaoff
/sbin/quotaon

So, I'm wondering if it's already in my system.

- Eve

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie"
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: Simple script to set permissions on folders daily - write script and cron it?
@ 2005-03-29 14:31 Mike Turcotte
  2005-03-29 15:54 ` Eve Atley
  0 siblings, 1 reply; 15+ messages in thread
From: Mike Turcotte @ 2005-03-29 14:31 UTC (permalink / raw)
  To: linux-newbie

I am fairly new to the linux scene, and I am currently using Gentoo
Linux. How exactly do I go about setting a global default umask value to
set 777 permissions on a particular folder and its contents?

Michael Turcotte
Information Systems
City of North Bay
200 McIntyre St. E
PO Box 360
North Bay, Ontario
P1B 8H8
 
Mike.Turcotte@cityofnorthbay.ca
http://www.cityofnorthbay.ca 

> -----Original Message-----
> From: linux-newbie-owner@vger.kernel.org [mailto:linux-newbie-
> owner@vger.kernel.org] On Behalf Of J.
> Sent: Monday, March 28, 2005 6:11 PM
> To: linux-newbie@vger.kernel.org
> Subject: Re: Simple script to set permissions on folders daily - write
> script and cron it?
> 
> On Mon, 28 Mar 2005, Eve Atley wrote:
> 
> > Hello! I want to write a very simple script that once daily (via
cron)
> will
> > set permissions to 777. This is to override any permissions set on
files
> > uploaded by other people, so everyone who already has access to the
> group
> > will have rwx access to the file(s).
> 
> You should do that by setting the `umask value' or configuring the
> programs that store the files correctly . No need for a
> cronscript. That is if they are only uploading and not accessing the
> shell interactively, even then you should go for a systemwide default
> `umask' value.
> 
> > So I'm double-checking if the best route is to create my script,
then
> run it
> > in cron as necessary. Or is there another way I should be handling
it?
> >
> > Here's the script:
> >
> > #!/bin/sh
> > #set_permissions: simple routine to set permissions of directories
to be
> > #accessible by everyone who already has specific group access.
> > #
> > #written by EMM - 3/28/2005
> >       cd /home/shared/hr/
> 
> Does the directory exsist you `cd' to ?
> test -d /home/shared/hr/ || echo "Error - .... and exittttt.. "
> or
> if [ ! -d /home/shared/hr/ ] ; then
>  print error..
> fi
> 
> > 	chmod 777 -R *
> 
> You say, `permissions of directorys' The above will set permissions of
> all files except for the dotted files.
> 
> You could walk the directory structure by means of `find' and evaluate
if
> the file is a directory file by `-type d'.
> find /home/shared/hr/ -type d -exec chmod 0755 '{}' \;
> 
> Then there is overhead, since every file no matter what the
permissions
> are is set. Check if the file needs permissions 777 and what the
current
> permissions are..
> 
> Other..., Maybe there are files that no matter what shouldn't be world
> readable and writable.. If multiple users are on your system they
could
> put a file in a certain directory, your cronscript goes over
> it, maybe as user root.. and.. makes it world readable/writable.. Not
a
> good thing. There is also a time gap inbetween the two different
> permissions, users can't access their files until your cronscript has
set
> the correct permissions. Yes running your cronscript every X sec's
will
> fix that, but that's not the way...
> 
>  > 	cd /home/shared/public
> > 	chmod 777 -R *
> > #put an exception here for /scans and /cd however
> > #????
> > 	cd /home/shared/accounting
> > 	chmod 777 -R *
> > Fi
> 
> There is no error wrapper in your script, it will keep running after
> errors or notifying messages have occurred. Cron takes also the exit
value
> of your script to determine if it's successful or not..
> 
> > Thanks much,
> > Eve
> 
> You should take more effort doing the `Unix filosofy', Do one thing
> and do it well.. [Right from the beginning in your case].
> 
> You are fixing symptoms, after the problem has occurred. E.G.
> 
> From the moment a file is stored on your system, it should have the
right
> permissions. That takes good configuration of the basics of your
system.
> 
> Before looking at these type of problems, try to imagine if you are
> running an ISP with 1000+ users. Who are constantly accessing their
files.
> 
> You surely don't want to run constantly cronscripts to fix every
> user/group rights management problem ?
> 
> GNU/Linux , Unix are multitasking, multiuser operatingsystems and they
> should be treated like that.. Otherwise you will loose all the
advantages
> of that at a certain given point..
> 
> GoodLuck..
> 
> J.
> 
> -
> To unsubscribe from this list: send the line "unsubscribe
linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 15+ messages in thread
[parent not found: <C6FD667B200BDF4F964C1BA77B796CE20F5E4A@cnbmail2.city.north -bay.on.ca>]
* RE: Simple script to set permissions on folders daily - write  script and cron it?
@ 2005-03-29 16:37 Mike Turcotte
  2005-03-29 17:02 ` J.
  0 siblings, 1 reply; 15+ messages in thread
From: Mike Turcotte @ 2005-03-29 16:37 UTC (permalink / raw)
  To: linux-newbie

That would be great if someone knew and could tell us how to set default
permissions on a specific directory.

The info that has been given here has been a help though, so thanks
everyone for helping me out!

Michael Turcotte
Information Systems
City of North Bay
200 McIntyre St. E
PO Box 360
North Bay, Ontario
P1B 8H8
 
Mike.Turcotte@cityofnorthbay.ca
http://www.cityofnorthbay.ca 

> -----Original Message-----
> From: linux-newbie-owner@vger.kernel.org [mailto:linux-newbie-
> owner@vger.kernel.org] On Behalf Of Ray Olszewski
> Sent: Tuesday, March 29, 2005 10:51 AM
> To: linux-newbie@vger.kernel.org
> Subject: RE: Simple script to set permissions on folders daily - write
> script and cron it?
> 
> At 09:31 AM 3/29/2005 -0500, Mike Turcotte wrote:
> >I am fairly new to the linux scene, and I am currently using Gentoo
> >Linux. How exactly do I go about setting a global default umask value
to
> >set 777 permissions on a particular folder and its contents?
> [...]
> 
> You don't. That's not how umask works. Instead, it sets default
> permissions
> for *all* files saved by a particular account (userid).
> 
> If you want to make this change for all userids (or all except root),
do
> it
> in some file that sets the environment globally. For the bash shell,
this
> is probably /etc/profile (that's the standard one, and I imagine
Gentoo
> follows the standard). For example, my /etc/profile file contains this
> line:
> 
>          umask 022
> 
> A umask is the (octal) inverse of permissions, so this sets the
default
> permissions to 755. For a default of 777, set the umask to 000.
> 
> If you want to make the change for specific accounts (userids), put a
line
> to reset the umash in that account's individual configuration file.
This
> varies in name a bitr more than systemwide files, but ones to look for
are
> (in the account's home directory) .profile, .bash_profile, or .bashrc
(use
> "ls -a" to display filenames that begin with a .).
> 
> I don't know of a way to set default permissions for a specific
directory
> only, which is why I didn't discourage Eve from taking the approach
she
> described for her problem. Perhaps someone else does, though ... we'll
> have
> to wait and see.
> 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe
linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: Simple script to set permissions on folders daily - write   script and cron it?
@ 2005-03-29 18:26 Mike Turcotte
  2005-03-29 18:45 ` J.
  0 siblings, 1 reply; 15+ messages in thread
From: Mike Turcotte @ 2005-03-29 18:26 UTC (permalink / raw)
  To: linux-newbie

For since this will be taking place on my file server with most files
being accessed through SMB, I think I will just take the approach of
setting the mask values in smb.conf. In my case that would probably be
the best bet to get what I want. It just sucks when someone creates a
folder to put music in, and no one else can add to that folder without
root going in and changing permissions.

Thanks,

Michael Turcotte
Information Systems
City of North Bay
200 McIntyre St. E
PO Box 360
North Bay, Ontario
P1B 8H8
 
Mike.Turcotte@cityofnorthbay.ca
http://www.cityofnorthbay.ca 

> -----Original Message-----
> From: linux-newbie-owner@vger.kernel.org [mailto:linux-newbie-
> owner@vger.kernel.org] On Behalf Of Ray Olszewski
> Sent: Tuesday, March 29, 2005 1:21 PM
> To: linux-newbie@vger.kernel.org
> Subject: RE: Simple script to set permissions on folders daily - write
> script and cron it?
> 
> At 07:02 PM 3/29/2005 +0200, J. wrote:
> >On Tue, 29 Mar 2005, Mike Turcotte wrote:
> >
> > > That would be great if someone knew and could tell us how to set
> default
> > > permissions on a specific directory.
> >
> >In the case if the directory is NOT a mount point:
> >This is done either from the command-line with `chmod' or if you want
> this
> >as a default, create a startup script in your /etc/init.d/
> >directory and make sure it's executed at the right run-level.
> >[depends on your GNU/Linux distro]. That way everytime your
> >system starts-up the directory is set to the right permissions.
> >
> >If the directory is a mountpoint, umount and remount it with the
> >permissions. /etc/fstab
> >
> >If you use samba, php, apache or any other deamon program to access
your
> >files set the file mask permissions in those programs correctly. And
make
> >sure the user & group settings under which these programs run on your
> >system have the right permissions todo so.
> [...]
> 
> J --
> 
> While everythig you've written here is quite correct, I think you
> misunderstood Mike's question. He's looking, I believe, for the same
thing
> Eve is ... a way to cause all files written to a particular directory,
no
> matter by whom, to have some particular mode ("default permissions")
that
> is defined independently of the account doing the creation (so the
> bash-based umask won't serve his purpose). In effect, he wants to set
a
> default umask not for a user but for a directory.
> 
> I have never run across any way to do this directly in Linux (or
Unix). If
> the files are all being created (or transferred) via some specific
> program,
> there *might* be a way to set a default umask for that program (as
samba
> does, for example ... do you know if any ftp and scp servers offer
this
> capability? wu-ftpd lists a -u switch, but I don't see anything for
stock
> sshd, which seems to use the uid's umask). But that's still different
from
> the directory itself.
> 
> Eve's proposed approach ... the cron script ... may seem a bit clunky
at
> first glance, but I suspect it really is the best solution for her,
and
> perhaps for Mike and anyone else who needs this capability.
> 
> Or am I missing something? I always feel on safer ground when
explaining
> how something *can* be done then when I say something *cannot* be
done.
> Still, something "no way" really is the correct answer.
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe
linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2005-03-29 19:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-23 20:28 Setting quota on user's home folders? Jessica_Schieffer
2005-03-28 21:02 ` Simple script to set permissions on folders daily - write script and cron it? Eve Atley
2005-03-28 21:05   ` John T. Williams
2005-03-28 21:35   ` Ray Olszewski
2005-03-28 23:11   ` J.
  -- strict thread matches above, loose matches on Subject: below --
2005-03-29 14:31 Mike Turcotte
2005-03-29 15:54 ` Eve Atley
2005-03-29 16:51   ` J.
     [not found] <C6FD667B200BDF4F964C1BA77B796CE20F5E4A@cnbmail2.city.north -bay.on.ca>
2005-03-29 15:51 ` Ray Olszewski
2005-03-29 16:37 Mike Turcotte
2005-03-29 17:02 ` J.
2005-03-29 18:20   ` Ray Olszewski
2005-03-29 19:27     ` J.
2005-03-29 18:26 Mike Turcotte
2005-03-29 18:45 ` J.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox