# File Issues
- Are quotas enforced?
- look at `/etc/fstab` for `usrquota` and/or `grpquota`
- `quotaoff` to disable quotas
- `repquota -a` to show all quotas
- Run out of disk space?
- `df -h` to show disk usage
- Inode exhaustion?
- `df -i` to show inode info for partitions ![[images/Pasted image 20250802190612.png]]
- Incorrect `umask` settings?
- `umask` value affects the default perms for newly created files/directories
- `umask` command shows current value that is subtracted from 666 for files and from 777 for directories ![[images/Pasted image 20250731130302.png]]
- change user umask value in `~/.profile` or `~/.bashrc` ![[images/Pasted image 20250731130325.png]]
- change global umask value in `/etc/profile`
- check DAC perms on file
- need rw to delete a file
- need rx to execute a script
- need rx to enter a directory
- use `ls -al` to determine user/group ownership and current perms
- set file perms with `chmod`
- set user ownership with `chown`
- set group ownership with `chgrp`
- add user to `/etc/sudoers` with `visudo`
- `id user_name` to show UID, GID, and groups for user
- `cat /etc/group | grep -i user_name` to show groups for user
- if sticky bit is set on a folder, users can only delete their own files
- Attributes set?
- run `lsattr file_name` to see associated attributes
- -i flag makes a file immutable
- Are ACLs enabled?
- `getfacl file_name` shows ACL for file
- Is SELinux or apparmor enabled?
- `sudo sestatus` shows selinux info
- `sudo aa-status` show apparmor status
- Policy violations stopping file creation/deletion?
- look at `/var/log/messages` or `/var/log/audit.log`
# FS Quota Limits
- `sudo apt update && sudo apt install -y quota`
- `quota --version` to test successful installation
- within `/etc/fstab` options add `usrquota, grpquota` to options for the root fs automatic mount point
- limits user allocation to fs
- `quotacheck -cug target_directory` creates quota files
- `quotaedit` to edit quota files in vim editor
- `quota -u user_name` to show quota info for user
- `repquota -a` to show all fs quotas