LOGIN\&.DEFS
Section: Formati di file e conversioni (5)
Updated: 29/03/2021
Page Index
NOME
login.defs - configurazione del pacchetto password shadow
DESCRIZIONE
The
/etc/login.defs
file defines the site-specific configuration for the shadow password suite. This file is required. Absence of this file will not prevent system operation, but will probably result in undesirable operation.
Questo file è un file di testo leggibile nel quale ogni riga descrive un parametro di configurazione. Le righe consistono di una coppia nome valore separati da spazi. Le righe vuote e di commento sono ignorate. I commenti iniziano con con il simbolo "#" che deve essere il primo carattere diverso da spazio della riga.
Parameter values may be of four types: strings, booleans, numbers, and long numbers. A string is comprised of any printable characters. A boolean should be either the value
yes
or
no. An undefined boolean parameter or one with a value other than these will be given a
no
value. Numbers (both regular and long) may be either decimal values, octal values (precede the value with
0) or hexadecimal values (precede the value with
0x). The maximum value of the regular and long numeric parameters is machine-dependent.
Please note that the parameters in this configuration file control the behavior of the tools from the shadow-utils component. None of these tools uses the PAM mechanism, and the utilities that use PAM (such as the passwd command) should be configured elsewhere. The only values that affect PAM modules are
ENCRYPT_METHOD
and
SHA_CRYPT_MAX_ROUNDS
for pam_unix module,
FAIL_DELAY
for pam_faildelay module, and
UMASK
for pam_umask module. Refer to pam(8) for more information.
Sono forniti i seguenti parametri di configurazione:
CHFN_AUTH (boolean)
-
If
yes, the
chfn
program will require authentication before making any changes, unless run by the superuser.
CHFN_RESTRICT (string)
-
This parameter specifies which values in the
gecos
field of the
/etc/passwd
file may be changed by regular users using the
chfn
program. It can be any combination of letters
f,
r,
w,
h, for Full name, Room number, Work phone, and Home phone, respectively. For backward compatibility,
yes
is equivalent to
rwh
and
no
is equivalent to
frwh. If not specified, only the superuser can make any changes. The most restrictive setting is better achieved by not installing
chfn
SUID.
CHSH_AUTH (boolean)
-
If
yes, the
chsh
program will require authentication before making any changes, unless run by the superuser.
CONSOLE (string)
-
Se definito, o il percorso completo di un file che contiene l'elenco di nomi di device (uno per riga) oppure un elenco di nomi di device separati da «:». L'accesso come root verrà permesso solo attraverso questi device.
Se non definito, root potrà accedere da qualsiasi device.
Il nome di device deve essere specificato senza il prefisso /dev.
CONSOLE_GROUPS (string)
-
List of groups to add to the user's supplementary groups set when logging in on the console (as determined by the CONSOLE setting). Default is none.
Use with caution - it is possible for users to gain permanent access to these groups, even when not logged in on the console.
CREATE_HOME (boolean)
-
Indica se per i nuovi utenti va creata la directory home.
Questa impostazione non viene applicata agli utenti di sistema e può essere modificata sulla riga di comando.
DEFAULT_HOME (boolean)
-
Indica se permettere l'accesso al sistema anche se non si può accedere alla directory home. Il valore predefinito è no.
If set to
yes, the user will login in the root (/) directory if it is not possible to cd to her home directory.
ENCRYPT_METHOD (string)
-
Definisce l'algoritmo di cifratura predefinito per le password (se non ne viene specificato uno a riga di comando).
It can take one of these values:
DES
(default),
MD5, SHA256, SHA512.
Note: this parameter overrides the
MD5_CRYPT_ENAB
variable.
ENV_HZ (string)
-
If set, it will be used to define the HZ environment variable when a user login. The value must be preceded by
HZ=. A common value on Linux is
HZ=100.
ENV_PATH (string)
-
If set, it will be used to define the PATH environment variable when a regular user login. The value is a colon separated list of paths (for example
/bin:/usr/bin) and can be preceded by
PATH=. The default value is
PATH=/bin:/usr/bin.
ENV_SUPATH (string)
-
If set, it will be used to define the PATH environment variable when the superuser login. The value is a colon separated list of paths (for example
/sbin:/bin:/usr/sbin:/usr/bin) and can be preceded by
PATH=. The default value is
PATH=/sbin:/bin:/usr/sbin:/usr/bin.
ENV_TZ (string)
-
If set, it will be used to define the TZ environment variable when a user login. The value can be the name of a timezone preceded by
TZ=
(for example
TZ=CST6CDT), or the full path to the file containing the timezone specification (for example
/etc/tzname).
If a full path is specified but the file does not exist or cannot be read, the default is to use
TZ=CST6CDT.
ENVIRON_FILE (string)
-
Se questo file esiste ed è leggibile, l'ambiente di login viene letto da lì. Ogni riga deve essere nella forma nome=valore.
Le righe che iniziano con «#» sono trattate come commenti e ignorate.
ERASECHAR (number)
-
Terminal ERASE character (010
= backspace,
0177
= DEL).
Il valore deve avere il prefisso «0» se in ottale, o «0x» se esadecimale.
FAIL_DELAY (number)
-
Numero di secondi prima che venga concesso un ulteriore tentativo dopo un accesso fallito.
FAILLOG_ENAB (boolean)
-
Enable logging and display of
/var/log/faillog
login failure info.
FAKE_SHELL (string)
-
If set,
login
will execute this shell instead of the users' shell specified in
/etc/passwd.
FTMP_FILE (string)
-
Se impostato, gli accessi falliti verranno tracciati in questo file nel formato utmp.
GID_MAX (number), GID_MIN (number)
-
Range of group IDs used for the creation of regular groups by
useradd,
groupadd, or
newusers.
The default value for
GID_MIN
(resp.
GID_MAX) is 1000 (resp. 60000).
HOME_MODE (number)
-
The mode for new home directories. If not specified, the
UMASK
is used to create the mode.
useradd
and
newusers
use this to set the mode of the home directory they create.
HUSHLOGIN_FILE (string)
-
Se definito, questo file inibisce quanto stampato durante l'accesso. Se viene specificato un percorso completo, la modalità silenziosa (hushed) viene attivata se in quel file è presente il nome dell'utente o della shell dell'utente. Se il percorso non è completo, allora la modalità silenziosa viene attivata se quel file è presente nella directory home dell'utente.
ISSUE_FILE (string)
-
Se definito, il file verrà mostrato prima del prompt di login.
KILLCHAR (number)
-
Terminal KILL character (025
= CTRL/U).
Il valore deve avere il prefisso «0» se in ottale, o «0x» se esadecimale.
LASTLOG_ENAB (boolean)
-
Abilita la memorizzazione e la stampa delle informazioni sulle date degli ultimi accessi in /var/log/lastlog.
LASTLOG_UID_MAX (number)
-
Highest user ID number for which the lastlog entries should be updated. As higher user IDs are usually tracked by remote user identity and authentication services there is no need to create a huge sparse lastlog file for them.
No
LASTLOG_UID_MAX
option present in the configuration means that there is no user ID limit for writing lastlog entries.
LOG_OK_LOGINS (boolean)
-
Abilita la tracciatura degli accessi avvenuti con successo.
LOG_UNKFAIL_ENAB (boolean)
-
Abilita l'inclusione dei nomi utente sconosciuti quando si registrano gli accessi falliti.
Nota: memorizzare i nomi sconosciuti potrebbe diventare un problema legato alla sicurezza se un utente inserisce la propria password al posto del nome utente.
LOGIN_RETRIES (number)
-
Massimo numero di tentativi di accesso per password errata.
LOGIN_STRING (string)
-
Il testo da utilizzare per richiedere la password. Il valore predefinito è «Password: » o una sua traduzione. Se si imposta questa variabile allora il testo non verrà tradotto.
If the string contains
%s, this will be replaced by the user's name.
LOGIN_TIMEOUT (number)
-
Numero massimo di secondi per l'accesso.
MAIL_CHECK_ENAB (boolean)
-
Abilita la verifica e stampa a video dello stato della casella di posta al momento dell'accesso al sistema.
Andrebbe disabilitato se i file di avvio della shell effettuano già questo controllo («mailx -e» o equivalente).
MAIL_DIR (string)
-
La directory di spool per la posta. Questa è necessaria per manipolare la casella di posta quando il corrispondente account utente viene modificato o cancellato. Se non è specificata viene utilizzato un valore impostato al momento della compilazione.
MAIL_FILE (string)
-
Imposta la posizione delle caselle di posta degli utenti relative alla loro directory home.
The
MAIL_DIR
and
MAIL_FILE
variables are used by
useradd,
usermod, and
userdel
to create, move, or delete the user's mail spool.
If
MAIL_CHECK_ENAB
is set to
yes, they are also used to define the
MAIL
environment variable.
MAX_MEMBERS_PER_GROUP (number)
-
Maximum members per group entry. When the maximum is reached, a new group entry (line) is started in
/etc/group
(with the same name, same password, and same GID).
Il valore predefinito è 0, che non pone nessun limite al numero di membri per gruppo.
Questa opzione (dividi gruppo) permette di limitare la lunghezza delle righe nel file «group». Questo è utile per essere certi che le righe per gruppi NIS non eccedano i 1024 caratteri.
Se si deve impostare questo limite, si può usare 25.
Nota: la divisione dei gruppi potrebbe non essere supportata da ogni strumento (anche all'interno del pacchetto Shadow). Non si dovrebbe utilizzare questa variabile a meno di esserci forzati.
MD5_CRYPT_ENAB (boolean)
-
Indicate if passwords must be encrypted using the MD5-based algorithm. If set to
yes, new passwords will be encrypted using the MD5-based algorithm compatible with the one used by recent releases of FreeBSD. It supports passwords of unlimited length and longer salt strings. Set to
no
if you need to copy encrypted passwords to other systems which don't understand the new algorithm. Default is
no.
This variable is superseded by the
ENCRYPT_METHOD
variable or by any command line option used to configure the encryption algorithm.
This variable is deprecated. You should use
ENCRYPT_METHOD.
MOTD_FILE (string)
-
Se definito è una lista di nomi di file con «messaggi del giorno» separati da «:» che vengono mostrati subito dopo l'accesso.
NOLOGINS_FILE (string)
-
Se definito è il nome di un file che impedisce l'accesso degli utenti non root. Il suo contenuto dovrebbe essere un messaggio che indica il motivo per il quale l'accesso è impedito.
OBSCURE_CHECKS_ENAB (boolean)
-
Abilita controlli addizionali durante il cambio password.
PASS_ALWAYS_WARN (boolean)
-
Avvisa riguardo password deboli (anche se le permette egualmente) se si è root.
PASS_CHANGE_TRIES (number)
-
Massimo numero di tentativi per cambiare una password (troppo facile).
PASS_MAX_DAYS (number)
-
Il numero massimo di giorni che una password può essere utilizzata. Se la password è più vecchia verrà imposto il suo cambiamento. Se non specificato viene assunto -1 (che disabilita questo controllo).
PASS_MIN_DAYS (number)
-
Il numero minimo di giorni tra due cambiamenti di password. Ogni tentativo di cambiare la password prima di questo periodo verrà rifiutato. Se non specificato viene assunto -1 (che disabilita questo controllo).
PASS_WARN_AGE (number)
-
Il numero di giorni per i quali un utente va avvisato che la sua password sta per scadere. Se zero l'utente viene avvisato solo alla scadenza. Un valore negativo indica che non si deve avvisare mai. Se non specificato allora non c'è nessun avviso.
PASS_MAX_DAYS,
PASS_MIN_DAYS
and
PASS_WARN_AGE
are only used at the time of account creation. Any changes to these settings won't affect existing accounts.
PASS_MAX_LEN (number), PASS_MIN_LEN (number)
-
Number of significant characters in the password for crypt().
PASS_MAX_LEN
is 8 by default. Don't change unless your crypt() is better. This is ignored if
MD5_CRYPT_ENAB
set to
yes.
PORTTIME_CHECKS_ENAB (boolean)
-
Enable checking of time restrictions specified in
/etc/porttime.
QUOTAS_ENAB (boolean)
-
Enable setting of resource limits from
/etc/limits
and ulimit, umask, and niceness from the user's passwd gecos field.
SHA_CRYPT_MIN_ROUNDS (number), SHA_CRYPT_MAX_ROUNDS (number)
-
When
ENCRYPT_METHOD
is set to
SHA256
or
SHA512, this defines the number of SHA rounds used by the encryption algorithm by default (when the number of rounds is not specified on the command line).
Con molti cicli è più difficile trovare una password usando la forza bruta. Ma va notato che è richiesta maggiore potenza di calcolo per autenticare gli utenti.
Se non specificato sarà la libc a scegliere il numero di cicli (5000).
Il valore deve essere compreso tra 1.000 e 999.999.999.
If only one of the
SHA_CRYPT_MIN_ROUNDS
or
SHA_CRYPT_MAX_ROUNDS
values is set, then this value will be used.
If
SHA_CRYPT_MIN_ROUNDS
>
SHA_CRYPT_MAX_ROUNDS, the highest value will be used.
SULOG_FILE (string)
-
Se definito, tutta l'attività di «su» viene tracciata in questo file.
SU_NAME (string)
-
Se definito è il nome del comando da mostrare quando si esegue «su -». Ad esempio, se lo di definisce come «su» allora «ps» mostrerà che il comando è «-su». Se non definito, «ps» mostrerà il nome della shell invocata, come «-sh».
SU_WHEEL_ONLY (boolean)
-
If
yes, the user must be listed as a member of the first gid 0 group in
/etc/group
(called
root
on most Linux systems) to be able to
su
to uid 0 accounts. If the group doesn't exist or is empty, no one will be able to
su
to uid 0.
SUB_GID_MIN (number), SUB_GID_MAX (number), SUB_GID_COUNT (number)
-
If
/etc/subuid
exists, the commands
useradd
and
newusers
(unless the user already have subordinate group IDs) allocate
SUB_GID_COUNT
unused group IDs from the range
SUB_GID_MIN
to
SUB_GID_MAX
for each new user.
The default values for
SUB_GID_MIN,
SUB_GID_MAX,
SUB_GID_COUNT
are respectively 100000, 600100000 and 65536.
SUB_UID_MIN (number), SUB_UID_MAX (number), SUB_UID_COUNT (number)
-
If
/etc/subuid
exists, the commands
useradd
and
newusers
(unless the user already have subordinate user IDs) allocate
SUB_UID_COUNT
unused user IDs from the range
SUB_UID_MIN
to
SUB_UID_MAX
for each new user.
The default values for
SUB_UID_MIN,
SUB_UID_MAX,
SUB_UID_COUNT
are respectively 100000, 600100000 and 65536.
SYS_GID_MAX (number), SYS_GID_MIN (number)
-
Range of group IDs used for the creation of system groups by
useradd,
groupadd, or
newusers.
The default value for
SYS_GID_MIN
(resp.
SYS_GID_MAX) is 101 (resp.
GID_MIN-1).
SYS_UID_MAX (number), SYS_UID_MIN (number)
-
Range of user IDs used for the creation of system users by
useradd
or
newusers.
The default value for
SYS_UID_MIN
(resp.
SYS_UID_MAX) is 101 (resp.
UID_MIN-1).
SYSLOG_SG_ENAB (boolean)
-
Enable "syslog" logging of
sg
activity.
SYSLOG_SU_ENAB (boolean)
-
Enable "syslog" logging of
su
activity - in addition to sulog file logging.
TTYGROUP (string), TTYPERM (string)
-
The terminal permissions: the login tty will be owned by the
TTYGROUP
group, and the permissions will be set to
TTYPERM.
By default, the ownership of the terminal is set to the user's primary group and the permissions are set to
0600.
TTYGROUP
can be either the name of a group or a numeric group identifier.
If you have a
write
program which is "setgid" to a special group which owns the terminals, define TTYGROUP to the group number and TTYPERM to 0620. Otherwise leave TTYGROUP commented out and assign TTYPERM to either 622 or 600.
TTYTYPE_FILE (string)
-
Se definito si tratta di un file che mappa le linee tty nella variabile d'ambiente TERM. Ogni riga del file è in un formato tipo «vt100 tty01».
UID_MAX (number), UID_MIN (number)
-
Range of user IDs used for the creation of regular users by
useradd
or
newusers.
The default value for
UID_MIN
(resp.
UID_MAX) is 1000 (resp. 60000).
ULIMIT (number)
-
Default
ulimit
value.
UMASK (number)
-
La maschera di permessi alla creazione dei file è inizializzata con questo valore. Se non specificato la maschera viene impostata a 022.
useradd
and
newusers
use this mask to set the mode of the home directory they create if
HOME_MODE
is not set.
It is also used by
login
to define users' initial umask. Note that this mask can be overridden by the user's GECOS line (if
QUOTAS_ENAB
is set) or by the specification of a limit with the
K
identifier in
limits(5).
USERDEL_CMD (string)
-
Se definito, questo comando viene eseguito quando si cancella un utente. Dovrebbe rimuovere tutti i compiti di stampa/cron/at di proprietà dell'utente da cancellare (passato come primo argomento).
Il codice d'uscita restituito dallo script non è preso in considerazione.
Here is an example script, which removes the user's cron, at and print jobs:
-
#! /bin/sh
# Check for the required argument.
if [ $# != 1 ]; then
echo "Usage: $0 username"
exit 1
fi
# Remove cron jobs.
crontab -r -u $1
# Remove at jobs.
# Note that it will remove any jobs owned by the same UID,
# even if it was shared by a different username.
AT_SPOOL_DIR=/var/spool/cron/atjobs
find $AT_SPOOL_DIR -name "[^.]*" -type f -user $1 -delete \;
# Remove print jobs.
lprm $1
# All done.
exit 0
USERGROUPS_ENAB (boolean)
-
Abilita l'impostazione dei bit di gruppo di umask in modo che siano gli stessi dei bit del proprietario (esempio: 022 -> 002, 077 -> 007) per utenti non root a condizione che uid e gid siano identici e che il nome utente sia lo stesso del gruppo primario.
If set to
yes,
userdel
will remove the user's group if it contains no more members, and
useradd
will create by default a group with the name of the user.
RIFERIMENTI INCROCIATI
I seguenti riferimenti incrociati mostrano quali programmi del pacchetto shadow password utilizzano quali parametri.
chgpasswd
-
ENCRYPT_METHOD MAX_MEMBERS_PER_GROUP MD5_CRYPT_ENAB
SHA_CRYPT_MAX_ROUNDS SHA_CRYPT_MIN_ROUNDS
chpasswd
-
ENCRYPT_METHOD MD5_CRYPT_ENAB
SHA_CRYPT_MAX_ROUNDS SHA_CRYPT_MIN_ROUNDS
gpasswd
-
ENCRYPT_METHOD MAX_MEMBERS_PER_GROUP MD5_CRYPT_ENAB
SHA_CRYPT_MAX_ROUNDS SHA_CRYPT_MIN_ROUNDS
groupadd
-
GID_MAX GID_MIN MAX_MEMBERS_PER_GROUP SYS_GID_MAX SYS_GID_MIN
groupdel
-
MAX_MEMBERS_PER_GROUP
groupmems
-
MAX_MEMBERS_PER_GROUP
groupmod
-
MAX_MEMBERS_PER_GROUP
grpck
-
MAX_MEMBERS_PER_GROUP
grpconv
-
MAX_MEMBERS_PER_GROUP
grpunconv
-
MAX_MEMBERS_PER_GROUP
lastlog
-
LASTLOG_UID_MAX
newgrp / sg
-
SYSLOG_SG_ENAB
newusers
-
ENCRYPT_METHOD GID_MAX GID_MIN MAX_MEMBERS_PER_GROUP MD5_CRYPT_ENAB HOME_MODE PASS_MAX_DAYS PASS_MIN_DAYS PASS_WARN_AGE
SHA_CRYPT_MAX_ROUNDS SHA_CRYPT_MIN_ROUNDS
SUB_GID_COUNT SUB_GID_MAX SUB_GID_MIN SUB_UID_COUNT SUB_UID_MAX SUB_UID_MIN SYS_GID_MAX SYS_GID_MIN SYS_UID_MAX SYS_UID_MIN UID_MAX UID_MIN UMASK
pwck
-
PASS_MAX_DAYS PASS_MIN_DAYS PASS_WARN_AGE
pwconv
-
PASS_MAX_DAYS PASS_MIN_DAYS PASS_WARN_AGE
useradd
-
CREATE_HOME GID_MAX GID_MIN HOME_MODE LASTLOG_UID_MAX MAIL_DIR MAX_MEMBERS_PER_GROUP PASS_MAX_DAYS PASS_MIN_DAYS PASS_WARN_AGE SUB_GID_COUNT SUB_GID_MAX SUB_GID_MIN SUB_UID_COUNT SUB_UID_MAX SUB_UID_MIN SYS_GID_MAX SYS_GID_MIN SYS_UID_MAX SYS_UID_MIN UID_MAX UID_MIN UMASK
userdel
-
MAIL_DIR MAIL_FILE MAX_MEMBERS_PER_GROUP USERDEL_CMD USERGROUPS_ENAB
usermod
-
LASTLOG_UID_MAX MAIL_DIR MAIL_FILE MAX_MEMBERS_PER_GROUP
VEDERE ANCHE
login(1),
passwd(1),
su(1),
passwd(5),
shadow(5),
pam(8).