permiso de Linux denegado en archivos de propietario


0

Tengo un colega con un problema realmente extraño. Usamos un script que nos coloca automáticamente en un directorio de trabajo y luego todos los archivos que creamos pertenecen a un determinado grupo del que formamos parte (no conozco el código y no puedo compartirlo, pero ese no es el problema por cierto). Siempre ha funcionado bien hasta hace 3 semanas. El problema es: al crear un archivo, está claro que el tipo es el propietario del archivo y todos (incluido él) que forman parte del grupo pueden acceder a él. Pero si luego hace un " su" a su propio nombre de usuario y ya no es considerado como miembro del grupo, ya no podrá acceder a sus archivos aunque todavía sea el propietario (esto es para cada archivo ubicado en el directorio de trabajo) . Incluso con un chmod 777. Cómo es eso posible ?

(Otra información: selinux parece deshabilitado, tenemos las mismas variables de entorno establecidas)

Información adicional: Esto es lo que getfaclhago en un archivo mío:

$ getfacl 01_EP_Tool_CB65RHS_Douglas.dat  
# file: 01_EP_Tool_CB65RHS_Douglas.dat  
# owner: my_username  
# group: gr-st_name  
user::rw-  
group::rw-  
other::---  

Aquí es lo mismo con el otro archivo:

$ getfacl resultat_001.xls  
# file: resultat_001.xls  
# owner: other_username  
# group: gr-st_name  
user::rwx  
group::rwx  
other::---  

Ahora ls -ld:

$ ll -ld 01_EP_Tool_CB65RHS_Douglas.dat  
-rw-rw---- 1 my_username gr-st_name 2957222 Jul 27 11:28 01_EP_Tool_CB65RHS_Douglas.dat

$ ls -ld resultat_001.xls  
-rwxrwx--- 1 other_username gr-st_name 3014 Jul 27 16:50 resultat_001.xls  

Ahora, después de la conexión, aquí está el resultado de id& groups:

$ id  
uid=47910(other_username) gid=147910(pgr-other_username) groups=1605(other_group8),2657(other_group9),2999(other_group1),3002(other_group2),3148(other_group3),3161(other_group4),3185(other_group5),3586(other_group6),3588(other_group7),3589(other_group10),3590(other_group11),3591(other_group12),3595(other_group1_d),3792(other_group13),3818(other_group14),3837(other_group14-2),3931(other_group13_s),**3972(gr-st_name)**,4007(other_group15),60419(other_group16),61055(other_group17),61115(other_group18),61123(other_group19),61127(other_group20),147910(pgr-other_username)

$ groups  
pgr-other_username other_group8 other_group9 other_group1 other_group2 other_group3 other_group4 other_group5 other_group6 other_group7 other_group10 other_group11 other_group12 other_group1_d other_group13 other_group14 other_group14-2 other_group13_s **gr-st_name** other_group15 other_group16 other_group17 other_group18 other_group19 other_group20

Luego, después de ingresar al entorno de trabajo:

$ id  
uid=47910(other_username) **gid=3972(gr-st_name)** groups=1605(other_group8),2657(other_group9),2999(other_group1),3002(other_group2),3148(other_group3),3161(other_group4),3185(other_group5),3586(other_group6),3588(other_group7),3589(other_group10),3590(other_group11),3591(other_group12),3595(other_group1_d),3792(other_group13),3818(other_group14),3837(other_group14-2),3931(other_group13_s),3972(gr-st_name),4007(other_group15),60419(other_group16),61055(other_group17),61115(other_group18),61123(other_group19),61127(other_group20),147910(pgr-other_username)

$ groups  
**gr-st_name** other_group8 other_group9 other_group1 other_group2 other_group3 other_group4 other_group5 other_group6 other_group7 other_group10 other_group11 other_group12 other_group1_d other_group13 other_group14 other_group14-2 other_group13_s other_group15 other_group16 other_group17 other_group18 other_group19 other_group20 pgr-other_username

Luego, después de su other_username:

$ id  
uid=47910(other_username) gid=147910(pgr-other_username) groups=1605(other_group8),2657(other_group9),2999(other_group1),3002(other_group2),3148(other_group3),3161(other_group4),3185(other_group5),3586(other_group6),3588(other_group7),3589(other_group10),3590(other_group11),3591(other_group12),3595(other_group1_d),3792(other_group13),3818(other_group14),3837(other_group14-2),3931(other_group13_s),**3972(gr-st_name)**,4007(other_group15),60419(other_group16),61055(other_group17),61115(other_group18),61123(other_group19),61127(other_group20),147910(pgr-other_username)

$ groups  
pgr-other_username other_group8 other_group9 other_group1 other_group2 other_group3 other_group4 other_group5 other_group6 other_group7 other_group10 other_group11 other_group12 other_group1_d other_group13 other_group14 other_group14-2 other_group13_s **gr-st_name** other_group15 other_group16 other_group17 other_group18 other_group19 other_group20

Con respecto a SELinux, él tiene:

$ cat /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#       enforcing - SELinux security policy is enforced.
#       permissive - SELinux prints warnings instead of enforcing.
#       disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
#       targeted - Only targeted network daemons are protected.
#       strict - Full SELinux protection.
SELINUXTYPE=targeted

En cuanto a por qué hace su con su propio nombre, es solo una forma de abandonar el grupo y permanecer en el mismo lugar.

Alguna información nueva y posiblemente interesante. Aunque el usuario siempre usa el inicio de sesión other_username , existe otra cuenta que también le pertenece: yet_another_username . Si lo hago fingercon ellos, ambos dan exactamente la misma información (como si estuvieran sincronizados):

$ finger other_username
Login: other_username                          Name: some_email_address
Directory: /home/other_username                Shell: /bin/bash
On since Fri Jul 28 10:34 (CEST) on pts/36 from some_machine
    48 minutes 30 seconds idle
On since Fri Jul 28 09:36 (CEST) on pts/82 from some_other_machine
    19 minutes 49 seconds idle
On since Fri Jul 28 10:35 (CEST) on pts/150 from localhost:28.0
   47 minutes 53 seconds idle
On since Fri Jul 28 10:39 (CEST) on pts/170 from localhost:28.0
   44 minutes 25 seconds idle
     (messages off)
No mail.
No Plan.


$ finger yet_another_username
Login: other_username                          Name: some_email_address
Directory: /home/other_username                Shell: /bin/bash
On since Fri Jul 28 10:34 (CEST) on pts/36 from some_machine
    48 minutes 46 seconds idle
On since Fri Jul 28 09:36 (CEST) on pts/82 from some_other_machine
    20 minutes 5 seconds idle
On since Fri Jul 28 10:35 (CEST) on pts/150 from localhost:28.0
   48 minutes 9 seconds idle
On since Fri Jul 28 10:39 (CEST) on pts/170 from localhost:28.0
   44 minutes 41 seconds idle
     (messages off)
No mail.
No Plan.

Compare lo que getfaclinforma para un archivo "en funcionamiento" con lo que muestra para un archivo "roto".
— Grawity

Muestre la salida de idy groupsantes y después de ejecutar su. (¿Y por qué está haciendo un sua su propio nombre de usuario en primer lugar?) Además, solo por si acaso , muestre la salida de ls -l(además de getfacl) en un archivo donde no tiene acceso (y uno en el que sí tiene, si hay alguno). De hecho, aclare: ¿es el problema solo con los archivos creados en las últimas tres semanas o ha afectado a todos los archivos (pero solo comenzó hace tres semanas)?
— G-Man

He añadido alguna información en mi publicación. Agregaré el resto en un par de horas.
— jeanpisstoute

Vea si apagar SELinux soluciona el problema. Si es así, vuelva a habilitar y corrija las restricciones de SELinux.
— davidgo

Creo que ya está deshabilitado. $ cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - SELinux is fully disabled. SELINUX=disabled # SELINUXTYPE= type of policy in use. Possible values are: # targeted - Only targeted network daemons are protected. # strict - Full SELinux protection. SELINUXTYPE=targeted
— jeanpisstoute

Respuestas:


1

Hay un límite de 16 grupos más allá del cual NFS no puede determinar si usted es parte del grupo, y el grupo que estábamos viendo era el 18º grupo, de ahí el problema.

Como no somos root en este sistema, no podemos hacer cosas como rpc.mountd -g(visto aquí http://www.xkyle.com/solving-the-nfs-16-group-limit-problem/ ) o usermod.

Entonces, la solución no hermosa pero pragmática será para que la usemos newgrpy la pondremos en el .bashrc

Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.