martes, 14 de febrero de 2012

LINUX-SEC: habilitar / deshabilitar cambio de usuario en sesión.


Es importante limitar las atribuciones de los usuarios, sin embargo, si no se bloquea el cambio de usuario, cualquier usuario que conozca la password de root podría cambiar a root durante la sesión, tomando control absoluto sober el server.

En el siguiente ejmplo, se habilita al usuario soporte para que cambie al usuario root durante la sesión.

agregar usuario "soporte" al grupo "wheel"
wheel:x:10:root,soporte

al ejecutar id soporte aparece el grupo wheel.
[root@localhost ~]# id soporte
uid=500(soporte) gid=500(soporte) groups=500(soporte),10(wheel)
[root@localhost ~]# 


solo los usuarios que pertenecen al grupo wheel pueden cambiar de usuario en sesion (su -)
[root@localhost ~]# vi /etc/pam.d/su
descomentar la linea:
# Uncomment the following line to require a user to be in the "wheel" group.
auth            required        pam_wheel.so use_uid

[root@localhost ~]# cat /etc/pam.d/su
#%PAM-1.0
auth            sufficient      pam_rootok.so
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth           sufficient      pam_wheel.so trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
auth            required        pam_wheel.so use_uid
auth            include         system-auth
account         sufficient      pam_succeed_if.so uid = 0 use_uid quiet
account         include         system-auth
password        include         system-auth
session         include         system-auth
session         optional        pam_xauth.so
[root@localhost ~]# 

No hay comentarios:

Publicar un comentario