!quota
zsh:1: command not found: quota
!sudo apt install quota
Reading package lists... Done Building dependency tree... Done Reading state information... Done Suggested packages: libnet-ldap-perl default-mta | mail-transport-agent The following NEW packages will be installed: quota 0 upgraded, 1 newly installed, 0 to remove and 233 not upgraded. Need to get 249 kB of archives. After this operation, 1,436 kB of additional disk space will be used. Get:1 http://http.kali.org/kali kali-rolling/main amd64 quota amd64 4.06-1+b2 [249 kB] Fetched 249 kB in 1s (187 kB/s)[0m Preconfiguring packages ... 78Selecting previously unselected package quota. (Reading database ... 399823 files and directories currently installed.) Preparing to unpack .../quota_4.06-1+b2_amd64.deb ... 7Progress: [ 0%] [..........................................................] 87Progress: [ 20%] [###########...............................................] 8Unpacking quota (4.06-1+b2) ... 7Progress: [ 40%] [#######################...................................] 8Setting up quota (4.06-1+b2) ... 7Progress: [ 60%] [##################################........................] 87Progress: [ 80%] [##############################################............] 8Processing triggers for man-db (2.11.2-3) ... Processing triggers for kali-menu (2023.4.5) ... 78
!quota
!mount
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel) proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) udev on /dev type devtmpfs (rw,nosuid,relatime,seclabel,size=966788k,nr_inodes=241697,mode=755,inode64) devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000) tmpfs on /run type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=201428k,mode=755,inode64) /dev/sda1 on / type ext4 (rw,relatime,seclabel,errors=remount-ro) securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) selinuxfs on /sys/fs/selinux type selinuxfs (rw,nosuid,noexec,relatime) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel,inode64) tmpfs on /run/lock type tmpfs (rw,nosuid,nodev,noexec,relatime,seclabel,size=5120k,inode64) cgroup2 on /sys/fs/cgroup type cgroup2 (rw,nosuid,nodev,noexec,relatime,seclabel,nsdelegate,memory_recursiveprot) pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime,seclabel) bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700) systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=30,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=14169) hugetlbfs on /dev/hugepages type hugetlbfs (rw,nosuid,nodev,relatime,seclabel,pagesize=2M) debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime,seclabel) mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime,seclabel) tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime,seclabel) configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime) fusectl on /sys/fs/fuse/connections type fusectl (rw,nosuid,nodev,noexec,relatime) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,nosuid,nodev,noexec,relatime) sunrpc on /run/rpc_pipefs type rpc_pipefs (rw,relatime) _mob on /win type vboxsf (rw,nodev,relatime) tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=201424k,nr_inodes=50356,mode=700,uid=1000,gid=1000,inode64) gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000) portal on /run/user/1000/doc type fuse.portal (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)
!cat /etc/fstab
UUID=5879c36a-b60c-4e4c-956c-ded28059cd48 / ext4 defaults,errors=remount-ro 0 1 /swapfile none swap defaults 0 0
!sudo sed -i "/remount-ro/s/\(remount-ro\)/\1,usrquota,grpquota/" /etc/fstab
!cat /etc/fstab
UUID=5879c36a-b60c-4e4c-956c-ded28059cd48 / ext4 defaults,errors=remount-ro,usrquota,grpquota 0 1 /swapfile none swap defaults 0 0
!sudo mount -o remount /
mount: (hint) your fstab has been modified, but systemd still uses the old version; use 'systemctl daemon-reload' to reload.
!mount | grep --color quota
/dev/sda1 on / type ext4 (rw,relatime,seclabel,quota,usrquota,grpquota,errors=remount-ro)
!ls -l /aq*
zsh:1: no matches found: /aq*
!sudo quotacheck -vcaugm
quotacheck: Your kernel probably supports ext4 quota feature but you are using external quota files. Please switch your filesystem to use ext4 quota feature as external quota files on ext4 are deprecated. quotacheck: Scanning /dev/sda1 [/] done quotacheck: Checked 38414 directories and 416487 files
!ls -l /aq*
-rw-------. 1 root root 9216 Oct 11 11:40 /aquota.group -rw-------. 1 root root 9216 Oct 11 11:40 /aquota.user
!quota
quota: Cannot open quotafile //aquota.user: Permission denied quota: Cannot open quotafile //aquota.user: Permission denied quota: Cannot open quotafile //quota.user: No such file or directory
!sudo quota
Disk quotas for user root (uid 0): none
!sudo repquota -v /
*** Report for user quotas on device /dev/sda1 Block grace time: 7days; Inode grace time: 7days Block limits File limits User used soft hard grace used soft hard grace ---------------------------------------------------------------------- root -- 16014360 0 0 450302 0 0 man -- 2372 0 0 157 0 0 www-data -- 4 0 0 3 0 0 _apt -- 12 0 0 3 0 0 nobody -- 4 0 0 1 0 0 systemd-network -- 16 0 0 4 0 0 tss -- 4 0 0 1 0 0 speech-dispatcher -- 4 0 0 1 0 0 lightdm -- 52 0 0 13 0 0 saned -- 4 0 0 1 0 0 colord -- 56 0 0 5 0 0 nm-openvpn -- 4 0 0 1 0 0 mysql -- 115440 0 0 203 0 0 stunnel4 -- 8 0 0 3 0 0 geoclue -- 4 0 0 1 0 0 Debian-snmp -- 4 0 0 1 0 0 ntpsec -- 4 0 0 1 0 0 rwhod -- 4 0 0 1 0 0 _gophish -- 8 0 0 2 0 0 statd -- 8 0 0 3 0 0 redis -- 184 0 0 5 0 0 postgres -- 39444 0 0 1007 0 0 mosquitto -- 8 0 0 2 0 0 inetsim -- 408 0 0 37 0 0 _gvm -- 64 0 0 16 0 0 kali -- 464044 0 0 3012 0 0 bpd02 -- 128 0 0 28 0 0 bpd03 -- 128 0 0 28 0 0 bpd04 -- 128 0 0 28 0 0 bpd -- 128 0 0 28 0 0 Statistics: Total blocks: 9 Data blocks: 2 Entries: 30 Used average: 15.000000
#edquota bpd4
!sudo setquota -u bpd04 0 0 0 30 /
!sudo quota bpd04
Disk quotas for user bpd04 (uid 1004): Filesystem blocks quota limit grace files quota limit grace /dev/sda1 128 0 0 28 0 30
!sudo quotaon -vuga
quotaon: Your kernel probably supports ext4 quota feature but you are using external quota files. Please switch your filesystem to use ext4 quota feature as external quota files on ext4 are deprecated. /dev/sda1 [/]: group quotas turned on /dev/sda1 [/]: user quotas turned on
!sudo sudo -u bpd04 touch /home/bpd04/novy
!sudo quota bpd04
Disk quotas for user bpd04 (uid 1004): Filesystem blocks quota limit grace files quota limit grace /dev/sda1 128 0 0 29 0 30
!sudo sudo -u bpd04 touch /home/bpd04/novy2
!sudo quota bpd04
Disk quotas for user bpd04 (uid 1004): Filesystem blocks quota limit grace files quota limit grace /dev/sda1 128 0 0 30* 0 30
!sudo sudo -u bpd04 touch /home/bpd04/novy3
sda1: write failed, user file limit reached. touch: cannot touch '/home/bpd04/novy3': Disk quota exceeded
!quota
Disk quotas for user kali (uid 1000): none