This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ===== Configurar cuotas para los usuarios en xfs ===== Modifique el archivo **/etc/fstab*** Busque la línea: <code> /dev/mapper/rhel_sablixti01-home /home xfs defaults 1 2 </code> Y modifíquela de la siguiente manera: <code> /dev/mapper/rhel_sablixti01-home /home xfs defaults,uquota 1 2 </code> Monte de nuevo el directorio /home: <code> umount /home mount /home </code> Puede validar que las cuotas estén activas con el siguiente comando: <code> /proc/mounts |grep home </code> La salida debe ser similar a la siguiente: <code> /dev/mapper/rhel_sablixti01-home /home xfs rw,seclabel,relatime,attr2,inode64,grpquota 0 0 </code> Todos los usuarios deben pertenecer a un grupo al cual se le va a asignar la cuota, para ello modifique el archivo **/etc/login.defs** Busque la línea: <code> USERGROUPS_ENAB yes </code> Y modifíquela de la siguiente manera: <code> USERGROUPS_ENAB no </code> Lo anterior agregará todos los usuarios al grupo **users** en lugar de crear un grupo primario para cada usuario. A continuación cree el archivo **/etc/profile.d/quota.sh** con el siguiente contenido: <code> #!/bin/bash # estebanmonge@riseup.net sudo /opt/scripts/set_user_quota.sh $USER #.EOF </code> Luego cree el archivo **/etc/sudoers.d/quota** con el siguiente contenido: <code> %users ALL = (root) NOPASSWD:EXEC:/opt/scripts/set_user_quota.sh </code> Luego cree el directorio **/opt/scripts**: <code> mkdir -p /opt/scripts </code> Y cree el archivo **/opt/scripts/set_user_quota.sh** con el siguiente contenido: <code> #!/bin/bash # estebanmonge@riseup.net QUOTA="512m" xfs_quota -x -c "limit bsoft=$QUOTA bhard=$QUOTA $1" /home #.EOF </code> ==== Referencias ==== * https://docs.oseems.com/general/application/ssh/disable-public-key-authentication * https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Storage_Administration_Guide/xfsquota.html * http://man7.org/linux/man-pages/man8/useradd.8.html * http://www.linuxquestions.org/questions/linux-newbie-8/set-disk-quota-for-newly-created-user-on-login-4175505432/