xref: /netbsd-src/libexec/identd/identd.8 (revision d8a6eb3c16706b2c641a4aaa461e8f112328c013)
1*d8a6eb3cSwiz.\" $NetBSD: identd.8,v 1.22 2016/12/12 10:07:48 wiz Exp $
277969777Smrg.\"
36310d365Schristos.\" This software is in the public domain.
4f90aa792Speter.\" Written by Peter Postma <peter@NetBSD.org>
5642afa18Scgd.\"
6b525cd90Schristos.Dd December 9, 2016
76310d365Schristos.Dt IDENTD 8
86310d365Schristos.Os
96310d365Schristos.Sh NAME
106310d365Schristos.Nm identd
1129dcd7f9Swiz.Nd TCP/IP Ident protocol server
126310d365Schristos.Sh SYNOPSIS
136310d365Schristos.Nm
1429dcd7f9Swiz.Op Fl 46beIilNnr
156310d365Schristos.Op Fl a Ar address
166310d365Schristos.Op Fl c Ar charset
176310d365Schristos.Op Fl F Ar format
18914d68e2Speter.Op Fl f Ar username
196310d365Schristos.Op Fl g Ar uid
206310d365Schristos.Op Fl L Ar username
21f90aa792Speter.Op Fl m Ar filter
226310d365Schristos.Op Fl o Ar osname
23f90aa792Speter.Op Fl P Ar address
246310d365Schristos.Op Fl p Ar portno
256310d365Schristos.Op Fl t Ar seconds
266310d365Schristos.Op Fl u Ar uid
276310d365Schristos.Sh DESCRIPTION
286310d365Schristos.Nm
296310d365Schristosis a TCP/IP server which implements the user identification protocol
306310d365Schristosas specified in RFC 1413.
316310d365Schristos.Pp
326310d365Schristos.Nm
336310d365Schristosoperates by looking up specific TCP/IP connections and returning
346310d365Schristosinformation which may or may not be associated with the process owning
356310d365Schristosthe connection.
366310d365Schristos.Pp
376310d365SchristosThe following options are available:
38914d68e2Speter.Bl -tag -width XXusernameXX
396310d365Schristos.It Fl 4
40914d68e2SpeterBind to IPv4 addresses only
41914d68e2Speter(valid with flag
42914d68e2Speter.Fl b ) .
436310d365Schristos.It Fl 6
44914d68e2SpeterBind to IPv6 addresses only
45914d68e2Speter(valid with flag
46914d68e2Speter.Fl b ) .
476310d365Schristos.It Fl a Ar address
486310d365SchristosBind to the specified
496310d365Schristos.Ar address .
506310d365SchristosThis may be an IPv4 or IPv6 address or even a hostname.
516310d365SchristosIf a hostname is specified then
526310d365Schristos.Nm
53914d68e2Speterwill resolve it to an address (or addresses) and will bind this address
54914d68e2Speter(valid with flag
55914d68e2Speter.Fl b ) .
566310d365Schristos.It Fl b
576310d365SchristosRun in the background (as daemon).
586310d365Schristos.It Fl c Ar charset
59914d68e2SpeterSpecify an optional character set designator to be included in replies.
606310d365Schristos.Ar charset
616310d365Schristosshould be a valid charset set as described in the
626310d365Schristos.Tn MIME RFC
636310d365Schristosin upper case characters.
646310d365Schristos.It Fl e
656310d365SchristosReturn
666310d365Schristos.Dq UNKNOWN-ERROR
676310d365Schristosinstead of the usual
686310d365Schristos.Dq NO-USER
696310d365Schristosor
706310d365Schristos.Dq INVALID-PORT
7129dcd7f9Swizerror replies.
726310d365Schristos.It Fl F Ar format
736310d365SchristosSpecify the format to display info.
74d6285bbfSwizThe allowed format specifiers are:
7529dcd7f9Swiz.Bd -literal
76db19dcecSmsaitoh%u	print user name
77db19dcecSmsaitoh%U	print user number
78db19dcecSmsaitoh%g	print (primary) group name
79db19dcecSmsaitoh%G	print (primary) group number
80db19dcecSmsaitoh%l	print list of all groups by name
81db19dcecSmsaitoh%L	print list of all groups by number
8229dcd7f9Swiz.Ed
836310d365Schristos.Pp
84db19dcecSmsaitohThe lists of groups (%l, %L) are comma-separated, and start with the primary
85d6285bbfSwizgroup which is not repeated.
86d6285bbfSwizAny other characters (preceded by %, and those not preceded by it)
87d6285bbfSwizare printed literally.
88914d68e2Speter.It Fl f Ar username
89914d68e2SpeterSpecify a fall back
90914d68e2Speter.Ar username .
9129dcd7f9SwizIf the lookup fails then this username will be returned.
92f90aa792SpeterThis can be useful for when running this service on a NAT host and
93f90aa792Speternot using the forward/proxy functionality.
946310d365Schristos.It Fl g Ar gid
956310d365SchristosSpecify the group id number or name which the server should switch to after
966310d365Schristosbinding itself to the TCP/IP port.
9729dcd7f9Swiz.It Fl I
9829dcd7f9SwizSame as
9929dcd7f9Swiz.Fl i
10029dcd7f9Swizbut without the restriction that the username in
10129dcd7f9Swiz.Pa .ident
10229dcd7f9Swizmust not match an existing user.
1036310d365Schristos.It Fl i
1046310d365SchristosIf the
1056310d365Schristos.Pa .ident
1066310d365Schristosfile exists in the home directory of the identified user, return the username
1076310d365Schristosfound in that file instead of the real username.
1086310d365SchristosIf the username found in
1096310d365Schristos.Pa .ident
1106310d365Schristosis that of an existing user, then the real username will be returned.
1116310d365Schristos.It Fl L Ar username
1126310d365SchristosSpecify a
1136310d365Schristos.Dq lie
1146310d365Schristos.Ar username .
115914d68e2Speter.Nm
116914d68e2Speterwill return this name for all valid ident requests.
11729dcd7f9Swiz.It Fl l
11829dcd7f9SwizUse
11929dcd7f9Swiz.Xr syslogd 8
120914d68e2Speterfor logging purposes.
121f90aa792Speter.It Fl m Ar filter
122f90aa792SpeterEnables forwarding of ident queries.
123f90aa792SpeterThe
124f90aa792Speter.Ar filter
125f90aa792Speterargument specifies which packet filter should be used to lookup the
126f90aa792Speterconnections, currently
127b525cd90Schristos.Sq ipfilter ,
128b525cd90Schristos.Sq npf ,
129f90aa792Speterand
130b525cd90Schristos.Sq pf
131f90aa792Speterare supported packet filters.
132f90aa792SpeterNote that
133f90aa792Speter.Nm
134f90aa792Speterchanges the ident queries to use the local port on the NAT host instead of
135f90aa792Speterthe local port on the forwarding host.
136f90aa792SpeterThis is needed because otherwise we can't do a lookup on the proxy host.
137f90aa792SpeterOn the proxy host,
138f90aa792Speter.Dq proxy mode
139f90aa792Spetershould be enabled with the
140f90aa792Speter.Fl P
141f90aa792Speterflag or
142f90aa792Speter.Dq lying mode
143f90aa792Speterwith the
144f90aa792Speter.Fl L
145f90aa792Speterflag.
1466310d365Schristos.It Fl N
1476310d365SchristosEnable
1486310d365Schristos.Pa .noident
1496310d365Schristosfiles.
1506310d365SchristosIf this file exists in the home directory of the identified user then return
1516310d365Schristos.Dq HIDDEN-USER
1526310d365Schristosinstead of the normal USERID response.
15329dcd7f9Swiz.It Fl n
15429dcd7f9SwizReturn numeric user IDs instead of usernames.
1556310d365Schristos.It Fl o Ar osname
1566310d365SchristosReturn
1576310d365Schristos.Ar osname
1586310d365Schristosinstead of the default
1596310d365Schristos.Dq UNIX .
160f90aa792Speter.It Fl P Ar address
161f90aa792SpeterSpecify a proxy server which will be used to receive proxied ident
162f90aa792Speterqueries from.
163f90aa792SpeterSee also the
164f90aa792Speter.Fl m
165f90aa792Speterflag how this operates.
1666310d365Schristos.It Fl p Ar portno
16729dcd7f9SwizSpecify an alternative port number under which the server should run.
168914d68e2SpeterThe default is port 113
169914d68e2Speter(valid with flag
170914d68e2Speter.Fl b ) .
1716310d365Schristos.It Fl r
1726310d365SchristosReturn a random name of alphanumeric characters.
1736310d365SchristosIf the
1746310d365Schristos.Fl n
1756310d365Schristosflag is also enabled then a random number will be returned.
1766310d365Schristos.It Fl t Ar seconds
1776310d365SchristosSpecify a timeout for the service.
1786310d365SchristosThe default timeout is 30 seconds.
1796310d365Schristos.It Fl u Ar uid
18029dcd7f9SwizSpecify the user id number or name to which the server should switch after
1816310d365Schristosbinding itself to the TCP/IP port.
1826310d365Schristos.El
18329dcd7f9Swiz.Sh FILES
18429dcd7f9Swiz.Pa /etc/inetd.conf
1856310d365Schristos.Sh EXAMPLES
1866310d365Schristos.Nm
1876310d365Schristosoperates from
1886310d365Schristos.Xr inetd 8
1896310d365Schristosor as standalone daemon.
1906310d365SchristosPut the following lines into
1916310d365Schristos.Xr inetd.conf 5
1926310d365Schristosto enable
1936310d365Schristos.Nm
1946310d365Schristosas an IPv4 and IPv6 service via inetd:
195eac46437Ssommerfeld.Pp
1966310d365Schristosident stream tcp nowait nobody /usr/libexec/identd identd -l
1976310d365Schristos.Pp
1986310d365Schristosident stream tcp6 nowait nobody /usr/libexec/identd identd -l
1996310d365Schristos.Pp
200914d68e2SpeterTo run
2016310d365Schristos.Nm
202914d68e2Speteras standalone daemon, use the
2036310d365Schristos.Fl b
204914d68e2Speterflag.
2056310d365Schristos.Sh SEE ALSO
20629dcd7f9Swiz.Xr inetd.conf 5 ,
20729dcd7f9Swiz.Xr inetd 8
208914d68e2Speter.Sh AUTHORS
209914d68e2SpeterThis implementation of
210914d68e2Speter.Nm
211914d68e2Speteris written by
212914d68e2Speter.An Peter Postma
213914d68e2Speter.Aq peter@NetBSD.org .
214914d68e2Speter.Sh CAVEATS
215914d68e2SpeterSince
216914d68e2Speter.Nm
217914d68e2Spetershould typically not be run as a privileged user or group,
218914d68e2Speter.Pa .ident
219914d68e2Speterfiles for use when running with the
220914d68e2Speter.Fl I
221914d68e2Speteror
222914d68e2Speter.Fl i
223914d68e2Speterflags will need to be world accessible.
224914d68e2SpeterThe same applies for
225914d68e2Speter.Pa .noident
226914d68e2Speterfiles when running with the
227914d68e2Speter.Fl N
228914d68e2Speterflag.
229914d68e2Speter.Pp
230914d68e2SpeterWhen forwarding is enabled with the
231914d68e2Speter.Fl m
232914d68e2Speterflag then
233914d68e2Speter.Nm
234914d68e2Speterwill need access to either
235b525cd90Schristos.Pa /dev/ipnat
236b525cd90Schristos(ipfilter),
237b525cd90Schristos.Pa /dev/pf
238b525cd90Schristos(pf), or
239b525cd90Schristos.Pa /dev/npf .
240914d68e2SpeterSince it's not a good idea to run
241914d68e2Speter.Nm
242914d68e2Speterunder root, you'll need to adjust group owner/permissions to the device(s)
243914d68e2Speterand run
244914d68e2Speter.Nm
245914d68e2Speterunder that group.
246