A user's home directory is on a server with quotas, and one person filled the shared `/home`. How do you stop this happening again?
IntermediateScenarioUsers, groups and access control
Answer
Situation read → Enforce per-user disk quotas.
What I'd do →
- For XFS, mount with
uquotain/etc/fstab(/dev/vg0/home /home xfs defaults,uquota 0 0) and remount/reboot. - Set limits:
sudo xfs_quota -x -c 'limit bsoft=9g bhard=10g alice' /home
sudo xfs_quota -x -c 'report -h' /home
- For ext4 use
usrquota, thenquotacheck -cum /home,quotaon /home,setquota -u alice 9G 10G 0 0 /home.
Why → Hard limits stop a single user from starving everyone; soft limits give a warning first.
Interview tip → XFS quota must be enabled at mount time; remount is not enough for the root filesystem.
More on Users, groups and access control
You need to onboard 50 new developers onto a shared build server, each with their own account and SSH key. How do you do it?BeginnerThree teams share one server and each needs a project directory only its members can write to, with new files staying group-owned. How do you set it up?BeginnerA junior engineer needs to restart nginx but must not get full root. How do you grant that?BeginnerAn engineer leaves the company today. What do you do with their Linux account on 30 servers?BeginnerA service account for a backup tool must exist on every server but nobody should be able to log in as it. How do you create it?BeginnerYour security team requires passwords to expire every 90 days for human users only. How do you implement it?Beginner