Hitchhiker's Guide to Openbsd
- How do I create an ftp-only account (not anonymous
Download 1.27 Mb. Pdf ko'rish
|
obsd-faq49
- Bu sahifa navigatsiya:
- 10.11 - Setting up Quotas
10.10 - How do I create an ftp-only account (not anonymous
FTP!)? http://www.openbsd.org/faq/faq10.html (12 of 32)9/4/2011 10:02:15 AM 10 - System Management There are a few ways to do this, but a very common way to do such is to add " /usr/bin/false " into " /etc/shells ". Then when you set a users shell to " /usr/bin/false ", they will not be able log in interactively, but will be able to use ftp capabilities. You may also want to restrict access by Confining users to their home directory in ftpd . 10.11 - Setting up Quotas Quotas are used to limit user's space that they have available to them on your disk drives. It can be very helpful in situations where you have limited resources. Quotas can be set by user and/or by group. The first step to setting up quotas is to make sure that " option QUOTA " is in your Kernel Configuration . This option is in the GENERIC kernel. After this, you need to mark in /etc/fstab the filesystems which will have quotas enabled. The keywords userquota and groupquota should be used to mark each filesystem that you will be using quotas on. By default, the files quota.user and quota.group will be created at the root of that filesystem to hold the quota information. This default can be overridden by specifying the file name with the quota option in /etc/fstab , such as " userquota=/var/ quotas/quota.user ". Here is an example /etc/fstab that has one filesystem with userquotas enabled, and the quota file in a non-standard location: /dev/wd0a / ffs rw,userquota=/var/quotas/quota.user 1 1 Now it's time to set the user's quotas. To do so you use the utility edquota(8) . A simple use is just " edquota ". edquota(8) will use vi(1) to edit the quotas unless the environmental variable EDITOR is set to a different editor. For example: # edquota ericj This will give you output similar to this: Quotas for user ericj: /: KBytes in use: 62, limits (soft = 0, hard = 0) inodes in use: 25, limits (soft = 0, hard = 0) To add limits, edit it to give results like this: Quotas for user ericj: /: KBytes in use: 62, limits (soft = 1000, hard = 1050) inodes in use: 25, limits (soft = 0, hard = 0) Note that the quota allocation is in 1k blocks. In this case, the softlimit is set to 1000k, and the hardlimit is set to 1050k. A softlimit is a limit where the user is just warned when they cross it and have until their http://www.openbsd.org/faq/faq10.html (13 of 32)9/4/2011 10:02:15 AM 10 - System Management grace period is up to get their disk usage below their limit. Grace periods can be set by using the -t option on edquota(8). After the grace period is over the softlimit is handled as a hardlimit. This usually results in an allocation failure. Now that the quotas are set, you need to turn the quotas on. To do this use quotaon(8) . For example: # quotaon -a This will go through /etc/fstab to turn on the filesystems with quota options. Now that quotas are up and running, you can view them using quota(1) . Using a command of " quota " will give that user's information. When called with no arguments, the quota(1) command will give your quota statistics. For example: # quota ericj Will result in output similar to this: Disk quotas for user ericj (uid 1001): Filesystem blocks quota limit grace files quota limit grace / 62 1000 1050 27 0 0 By default quotas set in /etc/fstab will be started on boot. To turn them off use # quotaoff -a Download 1.27 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2025
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling