PW.CONF(5)
π PW.CONF(5) β like, the whole vibe π
okay bestie, so this is PW.CONF(5) from the File Formats Manual section β it's the manual page for pw.conf, and it's genuinely more useful than it looks. let's get into it π
β¨ NAME β¨
pw.conf β the format of the pw.conf configuration file. that's it, that's the name, she's simple and she knows it π«Ά
π DESCRIPTION π
so the file /etc/pw.conf holds configuration data for the pw(8) utility β and if you don't know her, pw(8) is the tool that maintains the system password and group files, which is how you add, delete, and change users and groups. iconic behaviour honestly.
you can change this file two ways: through the pw(8) command using the useradd command and the -D option, or by just opening it up and editing it directly with a text editor. both valid, both slay π₯
each line in /etc/pw.conf is treated either as a comment or as configuration data. blank lines and lines starting with a # character? comments, bestie, ignored. any remaining lines get examined for a leading keyword, followed by the corresponding data. that's the whole system, no cap.
π the keywords pw(8) actually recognizes
defaultpasswdβ affects the passwords generated for new usersreuseuidsβ reuse gaps in uid sequencesreusegidsβ reuse gaps in gid sequencesnispasswdβ path to the NIS passwd databaseskeletonβ where to obtain default home contentsnewmailβ mail to send to new userslogfileβ log user/group modifications to this filehomeβ root directory for home directorieshomemodeβ permissions for home directoryshellpathβ paths in which to locate shell programsshellsβ list of valid shells (without path)defaultshellβ default shell (without path)defaultgroupβ default groupextragroupsβ add new users to this groupsdefaultclassβ place new users in this login classminuid,maxuidβ range of valid default user idsmingid,maxgidβ range of valid default group idsexpire_daysβ days after which account expirespassword_daysβ days after which password expires
ποΈ valid values for defaultpasswd
noβ disable login on newly created accountsyesβ force the password to be the account namenoneβ force a blank passwordrandomβ generate a random password
β οΈ okay so listen β the second and third options (yesandnone) are insecure and should be avoided if possible on a publicly accessible system. like, fr fr, don't do it on a shared box.
the first option (no) requires that the superuser run passwd(1) to set a password before the account may be used. this may also be useful for creating administrative accounts. the final option (random) causes pw(8) to respond by printing a randomly generated password on stdout β and this one is the preferred and most secure option π. pw(8) also gives you a way to set a specific password for the new user via a filehandle (because command lines are not secure, periodt).
π reuseuids & reusegids
both reuseuids and reusegids determine the method by which new user and group id numbers get generated. a yes in this field makes pw(8) search for the first unused user or group id within the allowed range. a no ensures that no other existing user or group id within the range is numerically lower than the new one being generated β so it avoids reusing gaps in the sequence that previous user or group deletions left behind. clever, right? π
also note: if the default group isn't specified using the defaultgroup keyword, pw(8) will create a new group for the user and attempt to keep the new user's uid and gid the same. and if the new user's uid happens to already be in use as a group id? then the next available group id is chosen instead. she adapts. πΈ
π nispasswd
on NIS servers that maintain a separate passwd database from /etc/master.passwd, this option lets that additional file be concurrently updated as user records are added, modified or removed. if it's blank or set to 'no', no additional database is updated. an absolute pathname must be used β no relative nonsense, iykyk.
π§Ί skeleton
the skeleton keyword nominates a directory from which the contents of a user's new home directory is constructed. this is /usr/share/skel by default. pw(8)'s -m option causes the user's home directory to be created and populated using the files contained in the skeleton directory. it's giving "starter pack" β¨
π¨ newmail
to send an initial email to new users, use the newmail keyword to specify a path name to a file containing the message body of the message to be sent. to avoid sending mail when accounts are created, leave this entry blank or specify 'no'.
πͺ΅ logfile
the logfile option allows logging of password file modifications into the nominated log file. to avoid creating or adding to such a logfile, leave this field blank or specify 'no'.
π home
the home keyword is mandatory β like, you literally cannot skip it β and it specifies the location of the directory in which all new user home directories get created.
π homemode
the homemode keyword is optional. it specifies the creation mask of the user's home directory and is modified by umask(2).
π shellpath
the shellpath keyword specifies a list of directories β separated by colons : β which contain the programs used by the login shells.
π shells
the shells keyword specifies a list of programs available for use as login shells. this list is a comma-separated list of shell names, which should not contain a path. these shells must exist in one of the directories nominated by shellpath.
π defaultshell
the defaultshell keyword nominates which shell program to use for new users when none is specified on the pw(8) command line.
π― defaultgroup
the defaultgroup keyword defines the primary group (the group id number in the password file) used for new accounts. if left blank, or the word 'no' is used, then each new user will have a corresponding group of their own created automatically. this is the recommended procedure for new users, because it best secures each user's files against interference by other users of the system β irrespective of the umask normally used by the user. main character energy for every single user, honestly π₯
π―ββοΈ extragroups
the extragroups keyword provides an automatic means of placing new users into groups within the /etc/groups file. super useful where all users share some resources, and preferable to placing users into the same primary group. the effect of this keyword can be overridden using the -G option on the pw(8) command line.
π defaultclass
the defaultclass field determines the login class (see login.conf(5)) that new users will be allocated, unless overwritten by pw(8).
π’ minuid, maxuid, mingid, maxgid
these keywords determine the allowed ranges of automatically allocated user and group id numbers. the default values for both user and group ids are 1000 and 32000 as minimum and maximum respectively. the user and group id's actually used when creating an account with pw(8) may be overridden using the -u and -g command line options.
β³ expire_days & password_days
these are used to automatically calculate the number of days from the date on which an account is created when the account will expire, or when the user will be forced to change the account's password. a value of '0' in either field will disable the corresponding (account or password) expiration date. so 0 is basically the "never mind, we're immortal" setting π
π§ LIMITS π§
the maximum line length of /etc/pw.conf is 1024 characters. longer lines get skipped and treated as comments β so if you write a whole essay on one line, bestie, it's just gonna be ignored π
π FILES π
/etc/pw.conf
/etc/passwd
/etc/master.passwd
/etc/group
π SEE ALSO π
passwd(1), umask(2), group(5), login.conf(5), passwd(5), pw(8)
that's the whole page, bestie β go forth and manage those users responsibly π¦π
this cutie comes to you from Debian, dated March 30, 2007 β vintage, but still serving β¨π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (C) 1996 David L. Nugent. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms