Use disk quota to manage Linux User Accounts

Source: Internet
Author: User
Article Title: Use the disk quota to manage Linux user accounts. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

The disk quota in Linux limits the disk space used by special user accounts. This tutorial describes how to create a disk quota on the system.

One advantage of Linux and other Unix-based operating systems is its multi-user processing capability. User Accounts benefit from the enhanced security of strict privileged separation. Multiple users can be active at the same time and can be accessed locally through input and output devices or remotely through network services. This advantage makes Linux an ideal system for multi-user workstations, application servers, and remote testing platforms.

These applications may face social challenges that do not appear on a single-user computer. One of the challenges is shared storage space, which is the fact that some users cannot share space with others for whatever reason. This may be due to the expectation of "evading" some consequences, just like the cake that always gets the most out of the box at a birthday party; or these problems may just cause the user to forget to share a computer, do not go or do not want to pay attention to their own disk usage. When a user starts to exclusively occupy the disk space and thus damages the interests of other users, it is necessary for the system administrator of a multi-user computer to think about how to use preset restrictions to control disk usage. In fact, it may be a good idea to consider (Disk Quota) in advance when creating a multi-user system. You cannot wait until someone has crossed a reasonable limit to take action.

You can interact with the disk space consortium and talk to them in theory. However, if they are reasonable, they will not put you into this situation at the beginning. If you do not make a plan in advance, you must carefully ask them to reduce disk space before you start to apply automated methods to limit and make them conform to the limits you intend to set. You can also use the public embarrassment method: publish the disk space usage statistics for each person who can access each other in a certain place, and hope the peer pressure will help your problem users to comply with the disk usage restrictions. However, this method won't succeed in most cases, and it may be your only choice for those you cannot limit their will-your boss-for political reasons. Generally, technical solutions are better choices than the above solutions. Fortunately, since most social problems involve computers, code hackers have begun to address the challenges that allow computers to handle other users in multiple ways, so that ordinary users do not have to do so.

If you have few users, you can create an independent partition for each user, and place them separately in the home directory of your multi-user computer file system. However, if the user group is constantly changing or there are many users, this method may soon be out of control and very difficult to manage. However, in case each user needs a large amount of storage space, application network connection storage is a reasonable management solution. In fact, you can apply a one-user-one disk method to solve the problem. Unfortunately, most multi-user system administrators do not realize that they are in this situation.

For most system administrators, the disk quota is the best solution. The disk quota in Linux limits the disk space used by special user accounts. Although many free and complex quota management systems with fancy devices and expensive business quota management systems can solve this problem, the simplest and most convenient solution is to solve the problem, is a basic command line for free applications by all mainstream Linux product administrators.QuotaTool set. The operating system can limit the storage space of different user accounts by using a commonly used disk quota system.

The disk quota can be configured separately for each user account. In addition, when a batch of users need to perform operations under the same restrictions, this configuration can also be easily copied. The system runs automatically and can be set to issue warnings and Grace times to users who exceed the limit but are within the preset upper limit, it is a beneficial, generous, but still efficient way to ensure that users comply with the quota. Different from applying a separate partition for each user account or the entire physical disk, in this case, the necessary modification to the disk quota is only a small matter. The biggest advantage of this method is that you don't have to face users directly, because once the disk quota system is set, the system will manage it on its own.

Prepare Disk Quota

Preparing for the system's disk quota involves several brief steps. These are one-time steps required when you decide to execute the quota system. Once the system disk quota is set, you do not have to perform these steps again.

Install

First, you must install the quota system. The installation method varies with the Linux system in use. However, if the system is not installed by default, your Linux package management system should provide a simple and convenient installation method for the quota system. To check whether the quota system is installed, open a Shell Interface and enterQuatoCommand; or useKtermOrGtermSuch a terminal simulator, or register on the TTY console. IfQuatoInstalled, and the user name isFoo, You will see the following code:

$ Quota

Disk quotas for user foo (uid 1000): none

If the quota system is not installed, you will receive a "command not found" response. If you get the disk quota information, it indicates that someone has executed the disk quota on your machine.

The following is an APT software management systemApt-getCommand to installQuotaExample:

$ Apt-get install quota

Reading package lists... Done

Building dependency tree... Done

The following NEW packages will be installed

Quota

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.

Need to get 439kB of archives.

After unpacking 1188kB of additional disk space will be used.

After the installation, more installation-related information will appear. Your Debian system will also ask you a lot of questions about handling quota violation reports. The Installation Process on other Linux products is very similar to the above process.

For some reason, your Linux product cannot be installed through the Package Manager.QuotaYou have to download and install the package from sourceforge.net/projects/linuxquota.

[1] [2] [3] Next page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.