getent(8) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

getent(8)

System Administration Commands                                       getent(8)



NAME
       getent - get entries from administrative database

SYNOPSIS
       getent database [key]...

DESCRIPTION
       getent  gets  a list of entries from the administrative database speci‐
       fied by database. The information generally comes from one or  more  of
       the sources that are specified for the database in /etc/nsswitch.conf.


       database  is the name of the database to be examined. This value can be
       passwd, group, hosts, ipnodes, services, protocols,  ethers,  networks,
       netmasks,  project,  user_attr,  prof_attr, auth_attr, exec_attr, auto‐
       mount, netgroup, initgroups, rpc, or shadow. For each  of  these  data‐
       bases, getent uses the appropriate library routines as described below.
       Many of the databases support enumeration if no key is specified on the
       command  line. Not all databases have documented libc(3LIB) interfaces.
       Man page references are supplied for each database that  has  supported
       and documented interfaces.


       Supported databases:

       passwd        Supported interfaces are documented in getpwnam(3C).


       group         Supported interfaces are documented in getgrnam(3C).


       hosts         Supported interfaces are documented in gethostbyname(3C).
                     The DNS repository does not enumerate the hosts database.


       ipnodes       Supported  interfaces  are  documented  in   getipnodeby‐
                     name(3C).  The DNS repository does not enumerate the ipn‐
                     odes database.


       services      Supported interfaces are documented in getservbyname(3C).


       protocols     Supported  interfaces  are  documented   in   getprotoby‐
                     name(3C).


       ethers        Supported  interfaces  are documented in ethers(3C). This
                     database does not support enumeration.


       networks      Supported interfaces are documented in getnetbyname(3C).


       netmasks      There are no public interfaces for  this  database.  This
                     database does not support enumeration.


       project       Supported   interfaces   are   documented  in  getprojby‐
                     name(3PROJECT).


       user_attr     Supported interfaces are documented in getuserattr(3C).


       prof_attr     Supported interfaces are documented in getprofattr(3C).


       auth_attr     Supported interfaces are documented in getauthattr(3C).


       exec_attr     Supported interfaces are documented in getexecattr(3C).


       netgroup      Supported interfaces are documented  in  getnetgrent(3C).
                     This database does not support enumeration.


       initgroups    Supported interfaces are documented in getgrouplist(3C).


       rpc           Supported interfaces are documented in getrpcbyname(3C).


       shadow        Supported interfaces are documented in getspnam(3C).



       The  getent  command  can  also be used to fetch entries from automount
       maps, by specifying the following value for database:

         automount/map



       In this case, getent retrieves the contents of  map  from  the  sources
       listed  for  automount  in /etc/nsswitch.conf. As with other databases,
       one or more specific search keys can be passed.


       Each key must be in a format appropriate for searching on  the  respec‐
       tive  database.  For  example,  it can be a username or numeric-uid for
       passwd; hostname or IP-address for hosts; or service, service/protocol,
       port, or port/proto for services.


       getent  prints each entry from the specified database that matches each
       specified key, one per line, in the format of the matching  administra‐
       tive  file:  passwd(5), group(5), project(5), networks(5), netmasks(5),
       user_attr(5), prof_attr(5), auth_attr(5), or exec_attr(5), or an  auto‐
       mount  map  file as described in automount(8). The key for exec_attr(5)
       is a profile name. If no key is given, all entries returned by the cor‐
       responding  enumeration  library routine (such as getpwent() or gethos‐
       tent()) are printed. Enumeration is not supported on  ipnodes,  ethers,
       netgroup, or netmasks.


       For  netgroup, either specify the netgroup name or specify the netgroup
       name plus the triples (hostname, username, and domainname) specified as
       keys. The getent command displays each triple that matches the netgroup
       name or each triple  that  matches  the  specified  netgroup  name  and
       triple.  The  asterisk  (*)  can be used as a wildcard in triples. Note
       that you might need to escape asterisks.

   Key Interpretation for passwd, group, and user_attr Databases
       When getent is invoked with database set to passwd, each key  value  is
       processed as follows:

           o      If the key value consists only of numeric characters, getent
                  assumes that the key value is a numeric user ID and searches
                  the user database for a matching user ID.


           o      If  the  user ID is not found in the user database or if the
                  key  value  contains  any  non-numeric  characters,   getent
                  assumes  the  key value is a user name and searches the user
                  database for a matching user name.



       Similarly, when getent is invoked with database set to group, each  key
       value is processed as follows:

           o      If the key value consists only of numeric characters, getent
                  assumes that the  key  value  is  a  numeric  group  ID  and
                  searches the group database for a matching group ID.


           o      If the group ID is not found in the group database or if the
                  key  value  contains  any  non-numeric  characters,   getent
                  assumes the key value is a group name and searches the group
                  database for a matching group name.



       When getent is invoked with database set to user_attr, each  key  value
       is processed as follows:

           o      If the key value consists only of numeric characters, getent
                  assumes that the key value is a numeric user ID and searches
                  the user database for a matching user ID.


           o      If the key value contains any non-numeric characters, getent
                  assumes the key value is a user name and searches  the  user
                  database for a matching user name.


EXAMPLES
       Example 1 Listing the Contents of a Database



       The  following example lists the entire contents of the protocols data‐
       base.


         $ getent protocols


       Example 2 Listing the Contents of an Automount Map



       The following example lists the  entire  contents  of  the  auto_master
       automount map.


         $ getent automount/auto_master


       Example  3 Displaying the Entries for a User in the auto_home Automount
       Map



       The following example displays the  entry  for  user  username  in  the
       auto_home automount map.


         $ getent automount/auto_home username


       Example 4 Displaying netgroup Triples



       The  following example output displays triples that match the specified
       netgroup name (workstations) and triple. Wildcards (*) can be specified
       in the triple.



       A match is shown as the netgroup triple equal to 1.


         $ getent netgroup workstations hostname fR
         workstations          (hostname,*,*) = 1



EXIT STATUS
       The following exit values are returned:

       0    Successful completion.


       1    Command  syntax  was  incorrect, an invalid option was used, or an
            internal error occurred.


       2    At least one of the specified entry names was  not  found  in  the
            database.


       3    There is no support for enumeration on this database.


FILES
       /etc/nsswitch.conf         Name service switch configuration file


       /etc/passwd                Password file


       /etc/group                 Group file


       /etc/inet/hosts            IPv4 and IPv6 host name database


       /etc/services              Internet services and aliases


       /etc/project               Project file


       /etc/protocols             Protocol name database


       /etc/ethers                Ethernet  address  to  hostname  database or
                                  domain


       /etc/networks              Network name database


       /etc/netmasks              Network mask database


       /etc/user_attr             Extended user attributes


       /etc/security/prof_attr    Profile description database


       /etc/security/auth_attr    Authorization description


       /etc/security/exec_attr    Execution profiles database


       /etc/auto_master           Automounter databases
       /etc/auto_home


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE VALUE _ Availabilitysystem/core-os _ Interface StabilityCommit‐
       ted


SEE ALSO
       ethers(3C), ether_hostton(3C), getauthattr(3C), getexecattr(3C), getgr‐
       nam(3C),  getgrouplist(3C), gethostbyaddr(3C), gethostbyname(3C), geth‐
       ostent(3C), getipnodebyaddr(3C), getipnodebyname(3C), getnetbyname(3C),
       getnetgrent(3C),   getprofattr(3C),  getprotobyname(3C),  getpwnam(3C),
       getservbyname(3C),    getspnam(3C),     getuserattr(3C),     getprojby‐
       name(3PROJECT),      getrpcbyname(3C),     auth_attr(5),     ethers(5),
       exec_attr(5),  group(5),  hosts(5),  netmasks(5),   networks(5),   nss‐
       witch.conf(5),  passwd(5), prof_attr(5), project(5), protocols(5), ser‐
       vices(5), user_attr(5), automount(8)



Oracle Solaris 11.4               05 Aug 2018                        getent(8)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3