1*4882a593Smuzhiyun# 2*4882a593Smuzhiyun# /etc/login.defs - Configuration control definitions for the shadow package. 3*4882a593Smuzhiyun# 4*4882a593Smuzhiyun# $Id: login.defs 3038 2009-07-23 20:41:35Z nekral-guest $ 5*4882a593Smuzhiyun# 6*4882a593Smuzhiyun 7*4882a593Smuzhiyun# 8*4882a593Smuzhiyun# Delay in seconds before being allowed another attempt after a login failure 9*4882a593Smuzhiyun# Note: When PAM is used, some modules may enfore a minimal delay (e.g. 10*4882a593Smuzhiyun# pam_unix enforces a 2s delay) 11*4882a593Smuzhiyun# 12*4882a593SmuzhiyunFAIL_DELAY 3 13*4882a593Smuzhiyun 14*4882a593Smuzhiyun# 15*4882a593Smuzhiyun# Enable logging and display of /var/log/faillog login failure info. 16*4882a593Smuzhiyun# 17*4882a593Smuzhiyun#FAILLOG_ENAB yes 18*4882a593Smuzhiyun 19*4882a593Smuzhiyun# 20*4882a593Smuzhiyun# Enable display of unknown usernames when login failures are recorded. 21*4882a593Smuzhiyun# 22*4882a593SmuzhiyunLOG_UNKFAIL_ENAB no 23*4882a593Smuzhiyun 24*4882a593Smuzhiyun# 25*4882a593Smuzhiyun# Enable logging of successful logins 26*4882a593Smuzhiyun# 27*4882a593SmuzhiyunLOG_OK_LOGINS no 28*4882a593Smuzhiyun 29*4882a593Smuzhiyun# 30*4882a593Smuzhiyun# Enable logging and display of /var/log/lastlog login time info. 31*4882a593Smuzhiyun# 32*4882a593Smuzhiyun#LASTLOG_ENAB yes 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun# 35*4882a593Smuzhiyun# Enable checking and display of mailbox status upon login. 36*4882a593Smuzhiyun# 37*4882a593Smuzhiyun# Disable if the shell startup files already check for mail 38*4882a593Smuzhiyun# ("mailx -e" or equivalent). 39*4882a593Smuzhiyun# 40*4882a593Smuzhiyun##MAIL_CHECK_ENAB yes 41*4882a593Smuzhiyun 42*4882a593Smuzhiyun# 43*4882a593Smuzhiyun# Enable additional checks upon password changes. 44*4882a593Smuzhiyun# 45*4882a593Smuzhiyun#OBSCURE_CHECKS_ENAB yes 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun# 48*4882a593Smuzhiyun# Enable checking of time restrictions specified in /etc/porttime. 49*4882a593Smuzhiyun# 50*4882a593Smuzhiyun#PORTTIME_CHECKS_ENAB yes 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun# 53*4882a593Smuzhiyun# Enable setting of ulimit, umask, and niceness from passwd gecos field. 54*4882a593Smuzhiyun# 55*4882a593Smuzhiyun#QUOTAS_ENAB yes 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun# 58*4882a593Smuzhiyun# Enable "syslog" logging of su activity - in addition to sulog file logging. 59*4882a593Smuzhiyun# SYSLOG_SG_ENAB does the same for newgrp and sg. 60*4882a593Smuzhiyun# 61*4882a593SmuzhiyunSYSLOG_SU_ENAB yes 62*4882a593SmuzhiyunSYSLOG_SG_ENAB yes 63*4882a593Smuzhiyun 64*4882a593Smuzhiyun# 65*4882a593Smuzhiyun# If defined, either full pathname of a file containing device names or 66*4882a593Smuzhiyun# a ":" delimited list of device names. Root logins will be allowed only 67*4882a593Smuzhiyun# upon these devices. 68*4882a593Smuzhiyun# 69*4882a593SmuzhiyunCONSOLE /etc/securetty 70*4882a593Smuzhiyun#CONSOLE console:tty01:tty02:tty03:tty04 71*4882a593Smuzhiyun 72*4882a593Smuzhiyun# 73*4882a593Smuzhiyun# If defined, all su activity is logged to this file. 74*4882a593Smuzhiyun# 75*4882a593Smuzhiyun#SULOG_FILE /var/log/sulog 76*4882a593Smuzhiyun 77*4882a593Smuzhiyun# 78*4882a593Smuzhiyun# If defined, ":" delimited list of "message of the day" files to 79*4882a593Smuzhiyun# be displayed upon login. 80*4882a593Smuzhiyun# 81*4882a593Smuzhiyun#MOTD_FILE /etc/motd 82*4882a593Smuzhiyun#MOTD_FILE /etc/motd:/usr/lib/news/news-motd 83*4882a593Smuzhiyun 84*4882a593Smuzhiyun# 85*4882a593Smuzhiyun# If defined, this file will be output before each login prompt. 86*4882a593Smuzhiyun# 87*4882a593Smuzhiyun#ISSUE_FILE /etc/issue 88*4882a593Smuzhiyun 89*4882a593Smuzhiyun# 90*4882a593Smuzhiyun# If defined, file which maps tty line to TERM environment parameter. 91*4882a593Smuzhiyun# Each line of the file is in a format something like "vt100 tty01". 92*4882a593Smuzhiyun# 93*4882a593Smuzhiyun#TTYTYPE_FILE /etc/ttytype 94*4882a593Smuzhiyun 95*4882a593Smuzhiyun# 96*4882a593Smuzhiyun# If defined, login failures will be logged here in a utmp format. 97*4882a593Smuzhiyun# last, when invoked as lastb, will read /var/log/btmp, so... 98*4882a593Smuzhiyun# 99*4882a593Smuzhiyun#FTMP_FILE /var/log/btmp 100*4882a593Smuzhiyun 101*4882a593Smuzhiyun# 102*4882a593Smuzhiyun# If defined, name of file whose presence which will inhibit non-root 103*4882a593Smuzhiyun# logins. The contents of this file should be a message indicating 104*4882a593Smuzhiyun# why logins are inhibited. 105*4882a593Smuzhiyun# 106*4882a593Smuzhiyun#NOLOGINS_FILE /etc/nologin 107*4882a593Smuzhiyun 108*4882a593Smuzhiyun# 109*4882a593Smuzhiyun# If defined, the command name to display when running "su -". For 110*4882a593Smuzhiyun# example, if this is defined as "su" then a "ps" will display the 111*4882a593Smuzhiyun# command is "-su". If not defined, then "ps" would display the 112*4882a593Smuzhiyun# name of the shell actually being run, e.g. something like "-sh". 113*4882a593Smuzhiyun# 114*4882a593SmuzhiyunSU_NAME su 115*4882a593Smuzhiyun 116*4882a593Smuzhiyun# 117*4882a593Smuzhiyun# *REQUIRED* 118*4882a593Smuzhiyun# Directory where mailboxes reside, _or_ name of file, relative to the 119*4882a593Smuzhiyun# home directory. If you _do_ define both, #MAIL_DIR takes precedence. 120*4882a593Smuzhiyun# 121*4882a593Smuzhiyun#MAIL_DIR /var/spool/mail 122*4882a593SmuzhiyunMAIL_FILE .mail 123*4882a593Smuzhiyun 124*4882a593Smuzhiyun# 125*4882a593Smuzhiyun# If defined, file which inhibits all the usual chatter during the login 126*4882a593Smuzhiyun# sequence. If a full pathname, then hushed mode will be enabled if the 127*4882a593Smuzhiyun# user's name or shell are found in the file. If not a full pathname, then 128*4882a593Smuzhiyun# hushed mode will be enabled if the file exists in the user's home directory. 129*4882a593Smuzhiyun# 130*4882a593SmuzhiyunHUSHLOGIN_FILE .hushlogin 131*4882a593Smuzhiyun#HUSHLOGIN_FILE /etc/hushlogins 132*4882a593Smuzhiyun 133*4882a593Smuzhiyun# 134*4882a593Smuzhiyun# If defined, either a TZ environment parameter spec or the 135*4882a593Smuzhiyun# fully-rooted pathname of a file containing such a spec. 136*4882a593Smuzhiyun# 137*4882a593Smuzhiyun#ENV_TZ TZ=CST6CDT 138*4882a593Smuzhiyun#ENV_TZ /etc/tzname 139*4882a593Smuzhiyun 140*4882a593Smuzhiyun# 141*4882a593Smuzhiyun# If defined, an HZ environment parameter spec. 142*4882a593Smuzhiyun# 143*4882a593Smuzhiyun# for Linux/x86 144*4882a593Smuzhiyun#ENV_HZ HZ=100 145*4882a593Smuzhiyun# For Linux/Alpha... 146*4882a593Smuzhiyun#ENV_HZ HZ=1024 147*4882a593Smuzhiyun 148*4882a593Smuzhiyun# 149*4882a593Smuzhiyun# *REQUIRED* The default PATH settings, for superuser and normal users. 150*4882a593Smuzhiyun# 151*4882a593Smuzhiyun# (they are minimal, add the rest in the shell startup files) 152*4882a593SmuzhiyunENV_SUPATH PATH=/sbin:/bin:/usr/sbin:/usr/bin 153*4882a593SmuzhiyunENV_PATH PATH=/bin:/usr/bin 154*4882a593Smuzhiyun 155*4882a593Smuzhiyun# 156*4882a593Smuzhiyun# Terminal permissions 157*4882a593Smuzhiyun# 158*4882a593Smuzhiyun# TTYGROUP Login tty will be assigned this group ownership. 159*4882a593Smuzhiyun# TTYPERM Login tty will be set to this permission. 160*4882a593Smuzhiyun# 161*4882a593Smuzhiyun# If you have a "write" program which is "setgid" to a special group 162*4882a593Smuzhiyun# which owns the terminals, define TTYGROUP to the group number and 163*4882a593Smuzhiyun# TTYPERM to 0620. Otherwise leave TTYGROUP commented out and assign 164*4882a593Smuzhiyun# TTYPERM to either 622 or 600. 165*4882a593Smuzhiyun# 166*4882a593SmuzhiyunTTYGROUP tty 167*4882a593SmuzhiyunTTYPERM 0600 168*4882a593Smuzhiyun 169*4882a593Smuzhiyun# 170*4882a593Smuzhiyun# Login configuration initializations: 171*4882a593Smuzhiyun# 172*4882a593Smuzhiyun# ERASECHAR Terminal ERASE character ('\010' = backspace). 173*4882a593Smuzhiyun# KILLCHAR Terminal KILL character ('\025' = CTRL/U). 174*4882a593Smuzhiyun# ULIMIT Default "ulimit" value. 175*4882a593Smuzhiyun# 176*4882a593Smuzhiyun# The ERASECHAR and KILLCHAR are used only on System V machines. 177*4882a593Smuzhiyun# The ULIMIT is used only if the system supports it. 178*4882a593Smuzhiyun# (now it works with setrlimit too; ulimit is in 512-byte units) 179*4882a593Smuzhiyun# 180*4882a593Smuzhiyun# Prefix these values with "0" to get octal, "0x" to get hexadecimal. 181*4882a593Smuzhiyun# 182*4882a593SmuzhiyunERASECHAR 0177 183*4882a593SmuzhiyunKILLCHAR 025 184*4882a593Smuzhiyun#ULIMIT 2097152 185*4882a593Smuzhiyun 186*4882a593Smuzhiyun# Default initial "umask" value for non-PAM enabled systems. 187*4882a593Smuzhiyun# UMASK is also used by useradd and newusers to set the mode of new home 188*4882a593Smuzhiyun# directories. 189*4882a593Smuzhiyun# 022 is the default value, but 027, or even 077, could be considered 190*4882a593Smuzhiyun# better for privacy. There is no One True Answer here: each sysadmin 191*4882a593Smuzhiyun# must make up her mind. 192*4882a593SmuzhiyunUMASK 022 193*4882a593Smuzhiyun 194*4882a593Smuzhiyun# 195*4882a593Smuzhiyun# Password aging controls: 196*4882a593Smuzhiyun# 197*4882a593Smuzhiyun# PASS_MAX_DAYS Maximum number of days a password may be used. 198*4882a593Smuzhiyun# PASS_MIN_DAYS Minimum number of days allowed between password changes. 199*4882a593Smuzhiyun# PASS_MIN_LEN Minimum acceptable password length. 200*4882a593Smuzhiyun# PASS_WARN_AGE Number of days warning given before a password expires. 201*4882a593Smuzhiyun# 202*4882a593SmuzhiyunPASS_MAX_DAYS 99999 203*4882a593SmuzhiyunPASS_MIN_DAYS 0 204*4882a593Smuzhiyun#PASS_MIN_LEN 5 205*4882a593SmuzhiyunPASS_WARN_AGE 7 206*4882a593Smuzhiyun 207*4882a593Smuzhiyun# 208*4882a593Smuzhiyun# If "yes", the user must be listed as a member of the first gid 0 group 209*4882a593Smuzhiyun# in /etc/group (called "root" on most Linux systems) to be able to "su" 210*4882a593Smuzhiyun# to uid 0 accounts. If the group doesn't exist or is empty, no one 211*4882a593Smuzhiyun# will be able to "su" to uid 0. 212*4882a593Smuzhiyun# 213*4882a593Smuzhiyun#SU_WHEEL_ONLY no 214*4882a593Smuzhiyun 215*4882a593Smuzhiyun# 216*4882a593Smuzhiyun# If compiled with cracklib support, where are the dictionaries 217*4882a593Smuzhiyun# 218*4882a593Smuzhiyun#CRACKLIB_DICTPATH /var/cache/cracklib/cracklib_dict 219*4882a593Smuzhiyun 220*4882a593Smuzhiyun# 221*4882a593Smuzhiyun# Min/max values for automatic uid selection in useradd 222*4882a593Smuzhiyun# 223*4882a593SmuzhiyunUID_MIN 1000 224*4882a593SmuzhiyunUID_MAX 60000 225*4882a593Smuzhiyun# System accounts 226*4882a593SmuzhiyunSYS_UID_MIN 101 227*4882a593SmuzhiyunSYS_UID_MAX 999 228*4882a593Smuzhiyun 229*4882a593Smuzhiyun# 230*4882a593Smuzhiyun# Min/max values for automatic gid selection in groupadd 231*4882a593Smuzhiyun# 232*4882a593SmuzhiyunGID_MIN 1000 233*4882a593SmuzhiyunGID_MAX 60000 234*4882a593Smuzhiyun# System accounts 235*4882a593SmuzhiyunSYS_GID_MIN 101 236*4882a593SmuzhiyunSYS_GID_MAX 999 237*4882a593Smuzhiyun 238*4882a593Smuzhiyun# 239*4882a593Smuzhiyun# Max number of login retries if password is bad 240*4882a593Smuzhiyun# 241*4882a593SmuzhiyunLOGIN_RETRIES 5 242*4882a593Smuzhiyun 243*4882a593Smuzhiyun# 244*4882a593Smuzhiyun# Max time in seconds for login 245*4882a593Smuzhiyun# 246*4882a593SmuzhiyunLOGIN_TIMEOUT 60 247*4882a593Smuzhiyun 248*4882a593Smuzhiyun# 249*4882a593Smuzhiyun# Maximum number of attempts to change password if rejected (too easy) 250*4882a593Smuzhiyun# 251*4882a593Smuzhiyun#PASS_CHANGE_TRIES 5 252*4882a593Smuzhiyun 253*4882a593Smuzhiyun# 254*4882a593Smuzhiyun# Warn about weak passwords (but still allow them) if you are root. 255*4882a593Smuzhiyun# 256*4882a593Smuzhiyun#PASS_ALWAYS_WARN yes 257*4882a593Smuzhiyun 258*4882a593Smuzhiyun# 259*4882a593Smuzhiyun# Number of significant characters in the password for crypt(). 260*4882a593Smuzhiyun# Default is 8, don't change unless your crypt() is better. 261*4882a593Smuzhiyun# Ignored if MD5_CRYPT_ENAB set to "yes". 262*4882a593Smuzhiyun# 263*4882a593Smuzhiyun#PASS_MAX_LEN 8 264*4882a593Smuzhiyun 265*4882a593Smuzhiyun# 266*4882a593Smuzhiyun# Require password before chfn/chsh can make any changes. 267*4882a593Smuzhiyun# 268*4882a593Smuzhiyun#CHFN_AUTH yes 269*4882a593Smuzhiyun 270*4882a593Smuzhiyun# 271*4882a593Smuzhiyun# Which fields may be changed by regular users using chfn - use 272*4882a593Smuzhiyun# any combination of letters "frwh" (full name, room number, work 273*4882a593Smuzhiyun# phone, home phone). If not defined, no changes are allowed. 274*4882a593Smuzhiyun# For backward compatibility, "yes" = "rwh" and "no" = "frwh". 275*4882a593Smuzhiyun# 276*4882a593SmuzhiyunCHFN_RESTRICT rwh 277*4882a593Smuzhiyun 278*4882a593Smuzhiyun# 279*4882a593Smuzhiyun# Password prompt (%s will be replaced by user name). 280*4882a593Smuzhiyun# 281*4882a593Smuzhiyun# XXX - it doesn't work correctly yet, for now leave it commented out 282*4882a593Smuzhiyun# to use the default which is just "Password: ". 283*4882a593Smuzhiyun#LOGIN_STRING "%s's Password: " 284*4882a593Smuzhiyun 285*4882a593Smuzhiyun# 286*4882a593Smuzhiyun# Only works if compiled with MD5_CRYPT defined: 287*4882a593Smuzhiyun# If set to "yes", new passwords will be encrypted using the MD5-based 288*4882a593Smuzhiyun# algorithm compatible with the one used by recent releases of FreeBSD. 289*4882a593Smuzhiyun# It supports passwords of unlimited length and longer salt strings. 290*4882a593Smuzhiyun# Set to "no" if you need to copy encrypted passwords to other systems 291*4882a593Smuzhiyun# which don't understand the new algorithm. Default is "no". 292*4882a593Smuzhiyun# 293*4882a593Smuzhiyun# Note: If you use PAM, it is recommended to use a value consistent with 294*4882a593Smuzhiyun# the PAM modules configuration. 295*4882a593Smuzhiyun# 296*4882a593Smuzhiyun# This variable is deprecated. You should use ENCRYPT_METHOD. 297*4882a593Smuzhiyun# 298*4882a593Smuzhiyun#MD5_CRYPT_ENAB no 299*4882a593Smuzhiyun 300*4882a593Smuzhiyun# 301*4882a593Smuzhiyun# Only works if compiled with ENCRYPTMETHOD_SELECT defined: 302*4882a593Smuzhiyun# If set to MD5 , MD5-based algorithm will be used for encrypting password 303*4882a593Smuzhiyun# If set to SHA256, SHA256-based algorithm will be used for encrypting password 304*4882a593Smuzhiyun# If set to SHA512, SHA512-based algorithm will be used for encrypting password 305*4882a593Smuzhiyun# If set to DES, DES-based algorithm will be used for encrypting password (default) 306*4882a593Smuzhiyun# Overrides the MD5_CRYPT_ENAB option 307*4882a593Smuzhiyun# 308*4882a593Smuzhiyun# Note: If you use PAM, it is recommended to use a value consistent with 309*4882a593Smuzhiyun# the PAM modules configuration. 310*4882a593Smuzhiyun# 311*4882a593Smuzhiyun#ENCRYPT_METHOD DES 312*4882a593Smuzhiyun 313*4882a593Smuzhiyun# 314*4882a593Smuzhiyun# Only works if ENCRYPT_METHOD is set to SHA256 or SHA512. 315*4882a593Smuzhiyun# 316*4882a593Smuzhiyun# Define the number of SHA rounds. 317*4882a593Smuzhiyun# With a lot of rounds, it is more difficult to brute forcing the password. 318*4882a593Smuzhiyun# But note also that it more CPU resources will be needed to authenticate 319*4882a593Smuzhiyun# users. 320*4882a593Smuzhiyun# 321*4882a593Smuzhiyun# If not specified, the libc will choose the default number of rounds (5000). 322*4882a593Smuzhiyun# The values must be inside the 1000-999999999 range. 323*4882a593Smuzhiyun# If only one of the MIN or MAX values is set, then this value will be used. 324*4882a593Smuzhiyun# If MIN > MAX, the highest value will be used. 325*4882a593Smuzhiyun# 326*4882a593Smuzhiyun# SHA_CRYPT_MIN_ROUNDS 5000 327*4882a593Smuzhiyun# SHA_CRYPT_MAX_ROUNDS 5000 328*4882a593Smuzhiyun 329*4882a593Smuzhiyun# 330*4882a593Smuzhiyun# List of groups to add to the user's supplementary group set 331*4882a593Smuzhiyun# when logging in on the console (as determined by the CONSOLE 332*4882a593Smuzhiyun# setting). Default is none. 333*4882a593Smuzhiyun# 334*4882a593Smuzhiyun# Use with caution - it is possible for users to gain permanent 335*4882a593Smuzhiyun# access to these groups, even when not logged in on the console. 336*4882a593Smuzhiyun# How to do it is left as an exercise for the reader... 337*4882a593Smuzhiyun# 338*4882a593Smuzhiyun#CONSOLE_GROUPS floppy:audio:cdrom 339*4882a593Smuzhiyun 340*4882a593Smuzhiyun# 341*4882a593Smuzhiyun# Should login be allowed if we can't cd to the home directory? 342*4882a593Smuzhiyun# Default in no. 343*4882a593Smuzhiyun# 344*4882a593SmuzhiyunDEFAULT_HOME yes 345*4882a593Smuzhiyun 346*4882a593Smuzhiyun# 347*4882a593Smuzhiyun# If this file exists and is readable, login environment will be 348*4882a593Smuzhiyun# read from it. Every line should be in the form name=value. 349*4882a593Smuzhiyun# 350*4882a593Smuzhiyun#ENVIRON_FILE /etc/environment 351*4882a593Smuzhiyun 352*4882a593Smuzhiyun# 353*4882a593Smuzhiyun# If defined, this command is run when removing a user. 354*4882a593Smuzhiyun# It should remove any at/cron/print jobs etc. owned by 355*4882a593Smuzhiyun# the user to be removed (passed as the first argument). 356*4882a593Smuzhiyun# 357*4882a593Smuzhiyun#USERDEL_CMD /usr/sbin/userdel_local 358*4882a593Smuzhiyun 359*4882a593Smuzhiyun# 360*4882a593Smuzhiyun# Enable setting of the umask group bits to be the same as owner bits 361*4882a593Smuzhiyun# (examples: 022 -> 002, 077 -> 007) for non-root users, if the uid is 362*4882a593Smuzhiyun# the same as gid, and username is the same as the primary group name. 363*4882a593Smuzhiyun# 364*4882a593Smuzhiyun# This also enables userdel to remove user groups if no members exist. 365*4882a593Smuzhiyun# 366*4882a593SmuzhiyunUSERGROUPS_ENAB yes 367*4882a593Smuzhiyun 368*4882a593Smuzhiyun# 369*4882a593Smuzhiyun# If set to a non-nul number, the shadow utilities will make sure that 370*4882a593Smuzhiyun# groups never have more than this number of users on one line. 371*4882a593Smuzhiyun# This permit to support split groups (groups split into multiple lines, 372*4882a593Smuzhiyun# with the same group ID, to avoid limitation of the line length in the 373*4882a593Smuzhiyun# group file). 374*4882a593Smuzhiyun# 375*4882a593Smuzhiyun# 0 is the default value and disables this feature. 376*4882a593Smuzhiyun# 377*4882a593Smuzhiyun#MAX_MEMBERS_PER_GROUP 0 378*4882a593Smuzhiyun 379*4882a593Smuzhiyun# 380*4882a593Smuzhiyun# If useradd should create home directories for users by default (non 381*4882a593Smuzhiyun# system users only) 382*4882a593Smuzhiyun# This option is overridden with the -M or -m flags on the useradd command 383*4882a593Smuzhiyun# line. 384*4882a593Smuzhiyun# 385*4882a593SmuzhiyunCREATE_HOME yes 386*4882a593Smuzhiyun 387