| AUTHSELECT-PROFILES(5) | AUTHSELECT-PROFILES(5) | 
NAME¶
authselect-profiles - cómo extender los perfiles authselect.
DESCRIPCIÓN¶
En este manual se explica cómo están organizados los perfiles de authselect y cómo crear otros nuevos.
DIRECTORIOS DE PERFILES¶
Los perfiles pueden estar en tres directorios.
/usr/share/authselect/default
/usr/share/authselect/vendor
/etc/authselect/custom
ARCHIVOS DE PERFIL¶
Cada perfil contiene uno o varios de estos archivos, con una descripción obligatoria y los cambios que se hacen en el sistema.
README
system-auth
password-auth, smartcard-auth, fingerprint-auth
postlogin
nsswitch.conf
dconf-db
dconf-locks
LÍNEAS CONDICIONALES¶
Cada uno de estos archivos se usa como una plantilla. Una plantilla es un archivo de texto que puede contener operadores opcionales para proporcionar diferentes características.
{continue if "característica"}
{stop if "característica"}
{include if "característica"}
{exclude if "característica"}
{imply "implied-feature" if "feature"}
{if "característica":verdadero|falso}
{if "característica":verdadero}
It is also possible to use logical expression in conditional line instead of specifying single feature name. In this case the expression will evaluate to true or false and the conditional operator will act upon the result.
The expression syntax consists of feature names (e.g. "feature") which returns true if the feature is defined or false if it is not defined and from the following logical operators: and, or and not. The expression may also be enclosed in parentheses and contain multiple subexpressions.
For example:
{if "feature1" or "feature2":true}
{if not "característica":verdadero|falso}
{if not "característica":verdadero}
{if "feature1" and ("feature2" or "feature3"):true}
EJEMPLO¶
Ejemplo con "if". Si se activa "with-sudo", se añade "sss" a la línea sudoers.
passwd:     sss files
group:      sss files
netgroup:   sss files
automount:  sss files
services:   sss files
sudoers:    files {if "with-sudo":sss}
Ejemplo con "continue-if" e "include-if". El archivo final estará vacío a no ser que se active "with-smartcard". Si además se activa "with-faillock" se incluirá soporte para pam_faillock.
{continue if "with-smartcard"}
auth        required                                     pam_env.so
auth        required                                     pam_faildelay.so delay=2000000
auth        required                                     pam_faillock.so preauth silent deny=4 unlock_time=1200 {include if "with-faillock"}
auth        [default=1 ignore=ignore success=ok]         pam_succeed_if.so uid >= 1000 quiet
auth        [default=1 ignore=ignore success=ok]         pam_localuser.so
auth        sufficient                                   pam_unix.so nullok
auth        requisite                                    pam_succeed_if.so uid >= 1000 quiet_success
auth        sufficient                                   pam_sss.so forward_pass
auth        required                                     pam_faillock.so authfail deny=4 unlock_time=1200       {include if "with-faillock"}
auth        required                                     pam_deny.so
...
Here is an example of "continue-if" using logical expression. The file will be empty unless "with-smartcard" or "with-smartcard-required" is set. This will simplify the call of authselect select command which does not have to include both features but only "with-smartcard-required" is necessary.
{continue if "with-smartcard" or "with-smartcard-required"}
auth        required                                     pam_env.so
auth        required                                     pam_faildelay.so delay=2000000
auth        required                                     pam_faillock.so preauth silent deny=4 unlock_time=1200 {include if "with-faillock"}
auth        [default=1 ignore=ignore success=ok]         pam_succeed_if.so uid >= 1000 quiet
auth        [default=1 ignore=ignore success=ok]         pam_localuser.so
auth        sufficient                                   pam_unix.so nullok
auth        requisite                                    pam_succeed_if.so uid >= 1000 quiet_success
auth        sufficient                                   pam_sss.so forward_pass
auth        required                                     pam_faillock.so authfail deny=4 unlock_time=1200       {include if "with-faillock"}
auth        required                                     pam_deny.so
...
Here is an example of "imply-if" operator. Enabling feature "with-smartcard-required" will also enable "with-smartcard" to make sure that all relevant PAM modules are used. This will achieve the same behavior as the previous example.
{imply "with-smartcard" if "with-smartcard-required"}
auth        required                                     pam_env.so
auth        required                                     pam_faildelay.so delay=2000000
auth        [success=1 default=ignore]                   pam_succeed_if.so service notin login:gdm:xdm:kdm:kde:xscreensaver:gnome-screensaver:kscreensaver quiet use_uid {include if "with-smartcard-required"}
auth        [success=done ignore=ignore default=die]     pam_sss.so require_cert_auth ignore_authinfo_unavail             {include if "with-smartcard-required"}
auth        [default=1 ignore=ignore success=ok]         pam_succeed_if.so uid >= 1000 quiet
auth        [default=1 ignore=ignore success=ok]         pam_localuser.so                                                 {exclude if "with-smartcard"}
auth        [default=2 ignore=ignore success=ok]         pam_localuser.so                                                 {include if "with-smartcard"}
auth        [success=done authinfo_unavail=ignore user_unknown=ignore ignore=ignore default=die] pam_sss.so try_cert_auth {include if "with-smartcard"}
auth        sufficient                                   pam_unix.so {if not "without-nullok":nullok}
auth        requisite                                    pam_succeed_if.so uid >= 1000 quiet_success
auth        sufficient                                   pam_sss.so forward_pass
auth        required                                     pam_deny.so
...
CREACIÓN DE NUEVOS PERFILES¶
Para poder usar un nuevo perfil con authselect, cree un directorio en alguno de los directorios de perfiles con los archivos anteriores. No es necesario incluir todos los archivos, sólo README es obligatorio, los demás estarán o no según las necesidades.
You may find authselect create-profile command helpful when creating new profile. See authselect(8) manual page or authselect create-profile --help for more information.
VÉASE TAMBIÉN¶
| 2018-02-17 |