Set Quota on your Linux system | All about OS

Set Quota on your Linux system

Категория: Securing and Optimizing

To enable group quota support on a file system, edit your fstab file (vi /etc/fstab) and add “grpquota” to the fourth field after the word “defaults” or any other options you may have set for this specific file system.
• To enable both users quota and group quota support on a file system, edit your fstab file (vi /etc/fstab) and add “usrquota.grpquota” to the fourth field after the word “defaults” or any other options you may have set for this specific file system.
Creation of the “quota.user” and “quota.group” files
After the modification of your 7etc/fstab” file, in order for quotas to be established on a file system, the root directory of the file system (i.e. /home in our example) must contain a file, owned by root, called “quota.user” if you want to use user quota, “quota.group” if you want to use group quota, or both if you want to use users and group quota.
Stepi
• To create the “quota.user” and/or “quota.group” files, as “root” go to the root of the partition you wish to enable quota (i.e. /home) and create “quota.user” and/or “quota.group” by doing:
[root@deep /]# touch /home/quota.user [root@deep /]# touch /home/quota.group [root@deep /]# chmod 600 /home/quota.user [root@deep /]# chmod 600 /home/quota.group
The “touch” command will create new empty files under the “home” directory named “quota.user” and “quota.group”. The “chmod” command will set the mode of these files to be read-write only by the super-user “root”.
NOTE: Both quota record files, “quota.user” and “quota.group”, should be owned by root, with read-write permission for “root” and none for anybody else.
Step 2
Now we must initialize the files “quota.user” and “quota.group” in the root directory of the file
system in order to not receive an error messages about quota during the reboot of our server.
• To initialize “quota.user” and/or “quota.group” files, use the following commands:
[root@deep /]# edquota -u wahib
[root@deep /]# edquota -g wahib
The steps above are necessary just to initialize the files “quota.user” and/or “quota.group”; the command edquota (-u) will edit the quota for the user “wahib” and (-g) will edit the quota for the group wahib. Note that you must edit an existing UID/GID on your system to initialize the files successfully.
Step 3
After you have finished setting the appropriate options for your quota program in the 7etc/fstab” file, and created and initialized the “quota.users”, and/or “quota.group” files, you must reboot the system for the changes you have made in the 7etc/fstab” file and/or the files “quota.user, quota.group” to take effect.

Страниц: 1 2 3 4 5

« Securities Software (Management & Limitation).Linux GnuPG