Print this page
3243 Add shadow support to getent(1)


   4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH GETENT 1M "Mar 26, 2007"
   7 .SH NAME
   8 getent \- get entries from administrative database
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 \fBgetent\fR \fIdatabase\fR [\fIkey\fR]...
  13 .fi
  14 
  15 .SH DESCRIPTION
  16 .sp
  17 .LP
  18 \fBgetent\fR gets a list of entries from the administrative database specified
  19 by \fIdatabase\fR. The information generally comes from one or more of the
  20 sources that are specified for the \fIdatabase\fR in \fB/etc/nsswitch.conf\fR.
  21 .sp
  22 .LP
  23 \fIdatabase\fR is the name of the database to be examined. This can be
  24 \fBpasswd\fR, \fBgroup\fR, \fBhosts\fR, \fBipnodes\fR, \fBservices\fR,
  25 \fBprotocols\fR, \fBethers\fR, \fBproject\fR, \fBnetworks\fR, or
  26 \fBnetmasks\fR. For each of these databases, \fBgetent\fR uses the appropriate
  27 library routines described in \fBgetpwnam\fR(3C), \fBgetgrnam\fR(3C),
  28 \fBgethostbyaddr\fR(3NSL), \fBgethostbyname\fR(3NSL),
  29 \fBgetipnodebyaddr\fR(3SOCKET), \fBgetipnodebyname\fR(3SOCKET),
  30 \fBgetservbyname\fR(3SOCKET), \fBgetprotobyname\fR(3SOCKET),
  31 \fBethers\fR(3SOCKET), \fBgetprojbyname\fR(3PROJECT) and
  32 \fBgetnetbyname\fR(3SOCKET), respectively.
  33 .sp
  34 .LP
  35 Each \fIkey\fR must be in a format appropriate for searching on the respective
  36 database. For example, it can be a \fIusername\fR or \fInumeric-uid\fR for
  37 \fBpasswd\fR; \fIhostname\fR or \fIIP\fR \fIaddress\fR for \fBhosts\fR; or
  38 \fIservice\fR, \fIservice/protocol\fR, \fIport\fR, or \fIport/proto\fR for
  39 \fBservices\fR.
  40 .sp
  41 .LP
  42 \fBgetent\fR prints out the database entries that match each of the supplied
  43 keys, one per line, in the format of the matching administrative file:
  44 \fBpasswd\fR(4), \fBgroup\fR(4), \fBproject\fR(4), \fBhosts\fR(4),
  45 \fBservices\fR(4), \fBprotocols\fR(4), \fBethers\fR(3SOCKET),
  46 \fBnetworks\fR(4), or \fBnetmasks\fR(4). If no key is given, all entries
  47 returned by the corresponding enumeration library routine, for example,
  48 \fBgetpwent()\fR or \fBgethostent()\fR, are printed. Enumeration is not
  49 supported on \fBipnodes\fR.
  50 .SS "Key Interpretation for \fBpasswd\fR and \fBgroup\fR Databases"
  51 .sp
  52 .LP
  53 When \fBgetent\fR is invoked with database set to \fBpasswd\fR, each key value
  54 is processed as follows:
  55 .RS +4
  56 .TP
  57 .ie t \(bu
  58 .el o
  59 If the key value consists only of numeric characters, \fBgetent\fR assumes that
  60 the key value is a numeric user ID and searches the user database for a
  61 matching user ID.
  62 .RE
  63 .RS +4
  64 .TP


 134 .ne 2
 135 .na
 136 \fB\fB/etc/nsswitch.conf\fR\fR
 137 .ad
 138 .RS 22n
 139 name service switch configuration file
 140 .RE
 141 
 142 .sp
 143 .ne 2
 144 .na
 145 \fB\fB/etc/passwd\fR\fR
 146 .ad
 147 .RS 22n
 148 password file
 149 .RE
 150 
 151 .sp
 152 .ne 2
 153 .na









 154 \fB\fB/etc/group\fR\fR
 155 .ad
 156 .RS 22n
 157 group file
 158 .RE
 159 
 160 .sp
 161 .ne 2
 162 .na
 163 \fB\fB/etc/inet/hosts\fR\fR
 164 .ad
 165 .RS 22n
 166 IPv4 and IPv6 host name database
 167 .RE
 168 
 169 .sp
 170 .ne 2
 171 .na
 172 \fB\fB/etc/services\fR\fR
 173 .ad




   4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH GETENT 1M "Mar 26, 2007"
   7 .SH NAME
   8 getent \- get entries from administrative database
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 \fBgetent\fR \fIdatabase\fR [\fIkey\fR]...
  13 .fi
  14 
  15 .SH DESCRIPTION
  16 .sp
  17 .LP
  18 \fBgetent\fR gets a list of entries from the administrative database specified
  19 by \fIdatabase\fR. The information generally comes from one or more of the
  20 sources that are specified for the \fIdatabase\fR in \fB/etc/nsswitch.conf\fR.
  21 .sp
  22 .LP
  23 \fIdatabase\fR is the name of the database to be examined. This can be
  24 \fBpasswd\fR, \fBshadow\fR, \fBgroup\fR, \fBhosts\fR, \fBipnodes\fR, \fBservices\fR,
  25 \fBprotocols\fR, \fBethers\fR, \fBproject\fR, \fBnetworks\fR, or
  26 \fBnetmasks\fR. For each of these databases, \fBgetent\fR uses the appropriate
  27 library routines described in \fBgetpwnam\fR(3C), \fBgetspnam\fR(3C), \fBgetgrnam\fR(3C),
  28 \fBgethostbyaddr\fR(3NSL), \fBgethostbyname\fR(3NSL),
  29 \fBgetipnodebyaddr\fR(3SOCKET), \fBgetipnodebyname\fR(3SOCKET),
  30 \fBgetservbyname\fR(3SOCKET), \fBgetprotobyname\fR(3SOCKET),
  31 \fBethers\fR(3SOCKET), \fBgetprojbyname\fR(3PROJECT) and
  32 \fBgetnetbyname\fR(3SOCKET), respectively.
  33 .sp
  34 .LP
  35 Each \fIkey\fR must be in a format appropriate for searching on the respective
  36 database. For example, it can be a \fIusername\fR or \fInumeric-uid\fR for
  37 \fBpasswd\fR; \fIhostname\fR or \fIIP\fR \fIaddress\fR for \fBhosts\fR; or
  38 \fIservice\fR, \fIservice/protocol\fR, \fIport\fR, or \fIport/proto\fR for
  39 \fBservices\fR.
  40 .sp
  41 .LP
  42 \fBgetent\fR prints out the database entries that match each of the supplied
  43 keys, one per line, in the format of the matching administrative file:
  44 \fBpasswd\fR(4), \fBshadow\fR(4), \fBgroup\fR(4), \fBproject\fR(4), \fBhosts\fR(4),
  45 \fBservices\fR(4), \fBprotocols\fR(4), \fBethers\fR(3SOCKET),
  46 \fBnetworks\fR(4), or \fBnetmasks\fR(4). If no key is given, all entries
  47 returned by the corresponding enumeration library routine, for example,
  48 \fBgetpwent()\fR or \fBgethostent()\fR, are printed. Enumeration is not
  49 supported on \fBipnodes\fR.
  50 .SS "Key Interpretation for \fBpasswd\fR and \fBgroup\fR Databases"
  51 .sp
  52 .LP
  53 When \fBgetent\fR is invoked with database set to \fBpasswd\fR, each key value
  54 is processed as follows:
  55 .RS +4
  56 .TP
  57 .ie t \(bu
  58 .el o
  59 If the key value consists only of numeric characters, \fBgetent\fR assumes that
  60 the key value is a numeric user ID and searches the user database for a
  61 matching user ID.
  62 .RE
  63 .RS +4
  64 .TP


 134 .ne 2
 135 .na
 136 \fB\fB/etc/nsswitch.conf\fR\fR
 137 .ad
 138 .RS 22n
 139 name service switch configuration file
 140 .RE
 141 
 142 .sp
 143 .ne 2
 144 .na
 145 \fB\fB/etc/passwd\fR\fR
 146 .ad
 147 .RS 22n
 148 password file
 149 .RE
 150 
 151 .sp
 152 .ne 2
 153 .na
 154 \fB\fB/etc/shadow\fR\fR
 155 .ad
 156 .RS 22n
 157 shadowed password file
 158 .RE
 159 
 160 .sp
 161 .ne 2
 162 .na
 163 \fB\fB/etc/group\fR\fR
 164 .ad
 165 .RS 22n
 166 group file
 167 .RE
 168 
 169 .sp
 170 .ne 2
 171 .na
 172 \fB\fB/etc/inet/hosts\fR\fR
 173 .ad
 174 .RS 22n
 175 IPv4 and IPv6 host name database
 176 .RE
 177 
 178 .sp
 179 .ne 2
 180 .na
 181 \fB\fB/etc/services\fR\fR
 182 .ad