LOGIN.CONF(5)
π
LOGIN.CONF(5) β the login.conf files, bestie β¨
okay so real quick: the manual name for this one is LOGIN.CONF, and it lives in section 5 (File Formats Manual). Buckle up, this is the login class capability database and she is long π
πΈ SYNOPSIS πΈ
/etc/login.conf, ~/.login_conf
like, those two paths. that's the whole synopsis. slay π
β¨ DESCRIPTION β¨
okay so login.conf contains various attributes and capabilities of login classes. simple as that. a login class β which is an optional annotation against each record in the user account database, /etc/master.passwd β determines session accounting, resource limits and user environment settings. it's giving "the vibe document for your whole session" honestly π₯
it gets used by various programs in the system to set up a user's login environment and to enforce policy, accounting and administrative restrictions. it also provides the means by which users are able to be authenticated to the system and the types of authentication available. lowkey iconic.
and heads up π«Ά β attributes in addition to the ones described here are available with third-party packages. so this page isn't the whole lore, iykyk.
π¦ the default and root records
there's a special record "default" in the system user class capability database /etc/login.conf that's used automatically for any non-root user without a valid login class in /etc/master.passwd.
and a user with a uid of 0 without a valid login class will use the record "root" if it exists, or "default" if not. periodt.
π the personal .login_conf
users may individually create a file called .login_conf in their home directory using the same format, consisting of a single entry with a record id of "me". yes bestie, you get your own little file π
if present, this file is used by login(1) to set user-defined environment settings which override those specified in the system login capabilities database.
β οΈ but only a subset of login capabilities may be overridden β typically those which do not involve authentication, resource limits and accounting. so don't get too comfy, you can't override everything from home π
π§ how records are built
records in a class capabilities database consist of a number of colon-separated fields.
the first entry for each record gives one or more names that a record is to be known by, each separated by a '|' character. the first name is the most common abbreviation. the last name given should be a long name that is more descriptive of the capability entry, and all others are synonyms. all names but the last should be in lower case and contain no blanks; the last name may contain upper case characters and blanks for readability. cute, structured, we love her π
π note that since a colon (:) is used to separate capability entries, a\cescape sequence must be used to embed a literal colon in the value or name of a capability. do NOT forget this one, it will bite you π
π compiling, aka the step everyone forgets
the default /etc/login.conf shipped with FreeBSD is an out of the box configuration. whenever changes to this, or the user's ~/.login_conf, file are made, the modifications will not be picked up until cap_mkdb(1) is used to compile the file into a database.
this database file will have a .db extension and is accessed through cgetent(3).
see getcap(3) for a more in-depth description of the format of a capability database. go read it, bestie, it's the sequel π
π CAPABILITIES π
fields within each record in the database follow the getcap(3) conventions for boolean, type string '=' and type numeric '#' β although type numeric is deprecated in favour of the string format, and either form is accepted for a numeric datum. (not me warning you about deprecated stuff, growth π)
values fall into the following categories:
boolβ if the name is present, then the boolean value is true; otherwise, it is false. that's it. presence-based. very minimal of her.fileβ path name to a data file.programβ path name to an executable file.listβ a list of values (or pairs of values) separated by commas or spaces.pathβ a space or comma separated list of path names, following the usualcshconventions (leading tilde with and without username being expanded to home directories etc.)numberβ a numeric value, either decimal (default), hexadecimal (with leading0x), or octal (with a leading0). with a numeric type, only one numeric value is allowed. numeric types may also be specified in string format (i.e., the capability tag being delimited from the value by'='instead of'#').
π¨ whichever method is used, then all records in the database must use the same method to allow values to be correctly overridden in interpolated records. consistency is the whole assignment, no cap. a numeric value may be infinite.
sizeβ a number which expresses a size. the default interpretation of a value is the number of bytes, but a suffix may specify alternate units:bβ explicitly selects 512-byte blockskβ selects kilobytes (1024 bytes)mβ specifies a multiplier of 1 megabyte (1048576 bytes),gβ specifies units of gigabytes, andtβ represents terabytes.
a size value is a numeric quantity and case of the suffix is not significant. concatenated values are added together. a size value may be infinite. π
timeβ a period of time, by default in seconds. a prefix may specify a different unit:yβ indicates the number of 365 day years,wβ indicates the number of weeks,dβ the number of days,hβ the number of hours,mβ the number of minutes, andsβ the number of seconds.
concatenated values are added together. for example, 2 hours and 40 minutes may be written either as 9600s, 160m or 2h40m. a time value may be infinite. β
okay now the infinite-value lore π
"infinity", "inf", "unlimited", "unlimit," and -1 are considered infinite values.
the usual convention to interpolate capability entries using the special tc=value notation may be used.
default values are specified in the 'Default' column. if there is no default, the value is inherited from the process setting up the login environment. (so like, whoever's holding the aux cord at that moment π§)
π₯ RESOURCE LIMITS π₯
here's the whole lineup, bestie. all of them:
coredumpsizeβ typesizeβ maximum coredump size limit.cputimeβ typetimeβ CPU usage limit.datasizeβ typesizeβ maximum data size limit.filesizeβ typesizeβ maximum file size limit.maxprocβ typenumberβ maximum number of processes.memorylockedβ typesizeβ maximum locked in core memory size limit.memoryuseβ typesizeβ maximum of core memory use size limit.openfilesβ typenumberβ maximum number of open files per process.sbsizeβ typesizeβ maximum permitted socketbuffer size.vmemoryuseβ typesizeβ maximum permitted total VM usage per process.stacksizeβ typesizeβ maximum stack size limit.pseudoterminalsβ typenumberβ maximum number of pseudo-terminals.swapuseβ typesizeβ maximum swap space size limit.umtxpβ typenumberβ maximum number of process-shared pthread locks.pipebufβ typesizeβ maximum size of pipe buffers.
none of them have a default listed, JSYK β the Default column is empty for all fifteen π«Ά
πΈ soft vs hard limits, the plot twist
these resource limit entries actually specify both the maximum and current limits (see getrlimit(2)).
the current (soft) limit is the one normally used, although the user is permitted to increase the current limit to the maximum (hard) limit.
and listen β the maximum and current limits may be specified individually by appending a -max or -cur to the capability name. so like, you get to be specific. main character energy π
β¨
π ENVIRONMENT π
okay bestie, this is the section where you get to shape the actual vibe of someone's login session π these are all the knobs that control the environment a user drops into β think env vars, search paths, priorities, and all that delicious stuff. Each one has a Type, a Default, and a job to do, and yes we're going through all of them, no skips π«Ά
charset(string, no default) β sets the$MM_CHARSETenvironment variable to whatever string you give it. literally just vibes but for character encoding β¨cpumask(string, no default) β a list of cpus to bind the user to π₯ the syntax is the same as for the-largument ofcpuset(1), or honestly you can just write the worddefault. and if it is set todefault, no action is taken β it's giving "I'm here but I'm not doing anything" πhushlogin(bool, defaultfalse) β same as having a~/.hushloginfile. shhh π€« quiet login hours.ignorenologin(bool, defaultfalse) β login is not prevented bynologin. it's giving rebel energy, lowkey.ftp-chroot(bool, defaultfalse) β limits FTP access withchroot(2)to the user'sHOMEdirectory. seeftpd(8)for the deets πlabel(string, no default) β the default MAC policy. seemaclabel(7)for the full lore πlang(string, no default) β sets the$LANGenvironment variable to the value you specify. speak your truth πmail(string, no default) β sets the$MAILenvironment variable to the value you specify. inbox check incoming π¬manpath(path, no default) β the default search path for manpages. where your docs live, iykyk πnocheckmail(bool, defaultfalse) β display mail status at login. yes, that's what the manpage says and we are not editorializing πnologin(file, no default) β if this file exists, it gets displayed and the login session gets terminated, periodt. like a "we're closed" sign but for your whole account πpath(path, default/bin /usr/bin) β the default search path. the classic.priority(number, default0) β the initial priority level. this one's a whole saga so buckle up π’ a value in the nice range (-20to20included), extended below with the 32 real-time class priorities (so-52maps to priority0in the real-time class,-51to1, and so on until-21which maps to31; seertprio(1)) and above with the 32 idle class priorities (so21maps to priority0in the idle class,22to1, and so on until52which maps to31; seeidprio(1)). special valueinheritprevents resetting the priority β main character energy, stays as-is πrequirehome(bool, defaultfalse) β requires a valid home directory to login. no home, no entry πsetenv(list, no default) β a comma-separated list of environment variables and the values they're to be set to. values containing commas must be quoted β οΈ don't get caught out bestie.shell(prog, no default) β the session shell to execute instead of the shell specified in the passwd file. plot twist: theSHELLenvironment variable will still contain the shell specified in the password file, so it's giving "the outfit changes but the ID doesn't" π¦term(string, no default) β the default terminal type, used if it can't be determined from other means. last-resort terminal energy π₯οΈtimezone(string, no default) β the default value of the$TZenvironment variable. timezone queen πΈumask(number, no default) β the initial umask. should always have a leading0to ensure octal interpretation, fr fr, don't skip the zero. special valueinheritexplicitly indicates not to change the umask β¨welcome(file, default/etc/motd) β the file containing the welcome message. your little entrance moment π
bestie reminder: these are capabilities, so they land in the login class stuff we already went over β and there's still more coming, don't go anywhere π
π AUTHENTICATION π
Okay bestie, these are the fields that actually handle who gets in and how β the whole glow-up of your login experience. Here's every single one, with types and defaults where they exist:
copyright(file) β File containing additional copyright informationhost.allow(list) β List of remote host wildcards from which users in the class may access.host.deny(list) β List of remote host wildcards from which users in the class may not access.login_prompt(string) β The login prompt given bylogin(1)login-backoff(number, default3) β The number of login attempts allowed before the backoff delay is inserted after each subsequent attempt. The backoff delay is the number of tries abovelogin-backoffmultiplied by 5 seconds.login-retries(number, default10) β The number of login attempts allowed before the login fails.passwd_format(string, defaultsha512) β The encryption format that new or changed passwords will use. Valid values include"des","md5","blf","sha256"and"sha512"; seecrypt(3)for details. NIS clients using a non-FreeBSD NIS server should probably use"des".passwd_prompt(string) β The password prompt presented bylogin(1)passwordtime(time) β Used bypasswd(1)to set next password expiry date.times.allow(list) β List of time periods during which logins are allowed.times.deny(list) β List of time periods during which logins are disallowed.ttys.allow(list) β List of ttys and ttygroups which users in the class may use for access.ttys.deny(list) β List of ttys and ttygroups which users in the class may not use for access.warnexpire(time) β Advance notice for pending account expiry.warnpassword(time) β Advance notice for pending password expiry.
These fields are intended to be used by passwd(1) and other programs in the login authentication system. π
Capabilities that set environment variables are scanned for both β~β and β$β characters, which are substituted for a user's home directory and name respectively. To pass these characters literally into the environment variable, escape the character by preceding it with a backslash '\'. No cap, that backslash is doing important work β respect it. π«Ά
π the host lists, explained
The host.allow and host.deny entries are comma separated lists used for checking remote access to the system, and consist of a list of hostnames and/or IP addresses against which remote network logins are checked. Items in these lists may contain wildcards in the form used by shell programs for wildcard matching (See fnmatch(3) for details on the implementation). The check on hosts is made against both the remote system's Internet address and hostname (if available).
So here's the vibe check on how they combine:
- If both lists are empty or not specified, then logins from any remote host are allowed. β¨ open door era
- If
host.allowcontains one or more hosts, then only remote systems matching any of the items in that list are allowed to log in. - If
host.denycontains one or more hosts, then a login from any matching hosts will be disallowed.
β° the time lists, explained
The times.allow and times.deny entries consist of a comma-separated list of time periods during which the users in a class are allowed to be logged in. These are expressed as one or more day codes followed by a start and end times expressed in 24 hour format, separated by a hyphen or dash.
For example, MoThSa0200-1300 translates to Monday, Thursday and Saturday between the hours of 2 am and 1 p.m.. Literally such a cute little schedule string, iykyk. π
And the rules:
- If both of these time lists are empty, users in the class are allowed access at any time.
- If
times.allowis specified, then logins are only allowed during the periods given. - If
times.denyis specified, then logins are denied during the periods given, regardless of whether one of the periods specified intimes.allowapplies. Yeah, deny wins. periodt.
Heads up bestie π β note that login(1) enforces only that the actual login falls within periods allowed by these entries. Further enforcement over the life of a session requires a separate daemon to monitor transitions from an allowed period to a non-allowed one. So it's giving "checked at the door, not the whole party."
π₯οΈ the tty lists, explained
The ttys.allow and ttys.deny entries contain a comma-separated list of tty devices (without the /dev/ prefix) that a user in a class may use to access the system, and/or a list of ttygroups (See getttyent(3) and ttys(5) for information on ttygroups).
The combinations, one by one:
- If neither entry exists, then the choice of login device used by the user is unrestricted.
- If only
ttys.allowis specified, then the user is restricted only to ttys in the given group or device list. - If only
ttys.denyis specified, then the user is prevented from using the specified devices or devices in the group. - If both lists are given and are non-empty, the user is restricted to those devices allowed by
ttys.allowthat are not available byttys.deny.
π one little superseded thing
The minpasswordlen and minpasswordcase facilities for enforcing restrictions on password quality, which used to be supported by login.conf, have been superseded by the pam_passwdqc(8) PAM module. Rip to them, they served their era. π
π RESERVED CAPABILITIES π
These following capabilities are reserved for the purposes indicated and may be supported by third-party software. Big emphasis moment: They are not implemented in the base system. So don't come for the base system when they don't do anything, bestie β that's a third-party plug-in situation. π
accounted(bool, defaultfalse) β Enable session time accounting for all users in this class.auth(list, defaultpasswd) β Allowed authentication styles. The first item is the default style.auth-type(list) β Allowed authentication styles for the authentication type.autodelete(time) β Time after expiry when account is auto-deleted.bootfull(bool, defaultfalse) β Enable 'boot only if ttygroup is full' strategy when terminating sessions.daytime(time) β Maximum login time per day.expireperiod(time) β Time for expiry allocation.graceexpire(time) β Grace days for expired account.gracetime(time) β Additional grace login time allowed.host.accounted(list) β List of remote host wildcards from which login sessions will be accounted.host.exempt(list) β List of remote host wildcards from which login session accounting is exempted.idletime(time) β Maximum idle time before logout.minpasswordlen(number, default6) β The minimum length a local password may be.mixpasswordcase(bool, defaulttrue) β Whetherpasswd(1)will warn the user if an all lower case password is entered.monthtime(time) β Maximum login time per month.refreshtime(time) β New time allowed on account refresh.refreshperiod(str) β How often account time is refreshed.sessiontime(time) β Maximum login time per session.sessionlimit(number) β Maximum number of concurrent login sessions on ttys in any group.ttys.accounted(list) β List of ttys and ttygroups for which login accounting is active.ttys.exempt(list) β List of ttys and ttygroups for which login accounting is exempt.warntime(time) β Advance notice for pending out-of-time.weektime(time) β Maximum login time per week.
The ttys.accounted and ttys.exempt fields operate in a similar manner to ttys.allow and ttys.deny as explained above. Similarly with the host.accounted and host.exempt lists. Symmetry, we love to see it. π¦
π SEE ALSO π
Your reading list, bestie β go click through all of these:
cap_mkdb(1)login(1)chroot(2)getcap(3)getttyent(3)login_cap(3)login_class(3)pam(3)passwd(5)ttys(5)ftpd(8)(ports/ftp/freebsd-ftpd)pam_passwdqc(8)
β HISTORY β
The file login.conf first appeared in FreeBSD 2.1.5. an icon, a legend, a pioneer πβ¨
and that's the whole page, bestie β you ate that π
This one's from the Debian fam, dated September 25, 2025, and it lives at LOGIN.CONF(5). Go forth and configure your classes with confidence, fr fr ππ¦π
π¦ where this page comes from
- freebsd 15.1: base 15.1
- Copyright (c) 1996 David Nugent <davidn@blaze.net.au>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms