📄 radwho.texi
字号:
@c This is part of the Radius manual.@c Copyright (C) 1999,2000,2001,2002,2003 Free Software Foundation, Inc.@c Written by Sergey Poznyakoff@c See file radius.texi for copying conditions.@comment *******************************************************************@node Radwho, Radlast, , Utility Programs@section @command{radwho}@pindex radwho@command{Radwho} displays the list of users currently logged in by theRadius server.Default output information is made compatible with that of the standard@UNIX{} @code{finger(1)} utility. For each user the following information isdisplayed: login name, name, connection protocol, @NAS{} port, login date,@NAS{} name, assigned IP or corresponding network name.When used with @option{-l} option, the long output format is used. Inthis format the following information is output:@table @samp@item LoginLogin name of the user@item SessionIDUnique session @sc{id} assigned by the terminal server.@item ProtoConnection prototype.@item PortPort number@item WhenLogin date and time@item FromName of the @NAS{} that accepted the connection.@item LocationFramed IP or the corresponding network name.@item CallerCaller station @sc{id} ad reported by the @NAS{}.@item DurationDuration of the session.@end table@menu* Options: radwho options. Command line options.* Format Strings::* Predefined Formats::@end menu@comment *L2****************************************************************@node radwho options@subsection @command{radwho} Command Line Options@cindex @command{radwho}, command line optionsThe following command line options can be used to modify the behaviorof the program:@table @option@item -A@itemx --allDisplay the information about logged-out users as well. The logged-outusers are shown with @samp{Proto} field set to HUP.@item -c@itemx --calling-idDisplay the calling station @sc{id} in the second column. Equivalent to@option{--format clid}.@item -d NAME@itemx --directory NAMESet the Radius configuration directory name.@item -D @var{fmt}@itemx --date-format @var{fmt}Set the date representation. Th @var{fmt} is usual @code{strftime(3)}format string. It defaults to @code{%a %H:%M}, i.e. the abbreviated weekdayname according to the current locale, and the hour and the minutes as two-digitdecimal numbers.@item -e @var{STRING}@itemx --empty @var{STRING}Display any empty field as @var{STRING}. This is useful when the output of@command{radwho} is fed to some analyzing program, as it helps to keepthe same number of columns on each line of output.@item -F@itemx --fingerStart in @command{fingerd} mode. In this mode @command{radwho} emulates thebehavior of the @command{fingerd(8)} utility. Use this option if starting@command{radwho} from the @file{/etc/inetd.conf} line like this @footnote{In this example the statement has beensplit on two lines to fit the page width. It must occupy a@emph{single line} in the real configuration file.}:@smallexamplefinger stream tcp nowait nobody /usr/sbin/radwhoradwho -fL@end smallexample@noindentThis mode is also enabled by default if @command{radwho} notices that itsname (@code{argv[0]}) is @samp{fingerd} or @samp{in.fingerd}.@item -H@itemx --no-headerDon't display header line.@item -i@itemx --session-idDisplay session @sc{id} instead of @sc{gecos} in the second column.Equivalent to @option{--format sid}.@item -I @itemx --ip-strip-domainDisplay hostnames without domain part.@item -u@itemx --local-alsoDisplay information about local users from the system @file{utmp} file.May prove useful when running @command{radwho} as a finger daemon.@item -n@itemx --no-resolveDo not resolve IP.@item -o @var{format}@itemx --format @var{format}Select customized output format. This can also be changed by settingthe value of environment variable @code{RADWHO_FORMAT}. The @var{format}is either a symbolic name of one of the predefined formats or a formatspecification (see next subsection).@item -s@itemx --secureRun in secure mode. Queries without a user name are rejected.@end table@comment *L2****************************************************************@node Format Strings@subsection @command{radwho} Format Strings@cindex @command{radwho}, format stringsA format string controls the output of every record from @file{radutmp}.It contains two types of objects: ordinary characters, which are simplycopied to the output, and format specifications, each of which causesoutput of a particular piece of information from the @file{radutmp}record.Each format specification starts with an opening brace and ends witha closing brace. The first word after the brace is the name of theformat specification. The rest of words are @dfn{positional arguments}followed by @dfn{keyword arguments}. Both are optional. The keywordarguments begin with a colon and must follow the positional arguments. The full list of format specifications follows.@deffn {Format Spec} newline [@var{count}]Causes the newline character to be output. If the optional @var{count}is supplied, that many newlines will be printed@end deffn@deffn {Format Spec} tab [@var{num}]Advance to the next tabstop in the output stream. If optional @var{num}is present, then skip @var{num} tabstops. Each tabstop is eightcharacters long.@end deffnThe following specifications output particular fields of a @file{radutmp}record. They all take two positional arguments: @var{width} and@var{title}.The first argument, @var{width} sets the maximum outputlength for this specification. If the number of characters actually outputis less than the width, they will be padded with whitespace either tothe left or to the right, depending on the presence of the @code{:right}keyword argument. If the number of characters is greater than @var{width}, theywill be truncated to fit. If @var{width} isnot given, the exact data are output as is.The second argument, @var{title}, gives the title of this column forthe heading line. By default no title is output.Every field specification accepts at least two keyword arguments.The keyword @code{:right} may be used to request alignment to the rightfor the data. This keyword is ignored if @var{width} is not given.The keyword @code{:empty} followed by a string causes @command{radwho}to output that string if the resulting value for this specificationwould otherwise be empty.@deffn {Format Spec} login @var{width} @var{title} [:empty @var{repl}][:right]Print the user login name.@end deffn@deffn {Format Spec} orig-login @var{width} @var{title} [:empty @var{repl}][:right]Print original login name as supplied with the request.@end deffn@deffn {Format Spec} gecos @var{width} @var{title} [:empty @var{repl}][:right]The @sc{gecos} field from the local @file{/etc/passwd} correspondingto the login name.If the user does not have a local account, his login name is output.@end deffn @deffn {Format Spec} nas-port @var{width} @var{title} [:empty @var{repl}][:right]@NAS{} port number@end deffn@deffn {Format Spec} session-id @var{width} @var{title} [:empty @var{repl}][:right]The session @acronym{ID}.@end deffn@deffn {Format Spec} nas-address @var{width} @var{title} [:empty @var{repl}][:right][:nodomain]The @NAS{} name or IP.The @code{:nodomain} keyword suppresses the output of the domain part ofthe name, i.e., the hostname is displayed only up to the first dot.@end deffn@deffn {Format Spec} framed-address @var{width} @var{title} [:empty @var{repl}][:right][:nodomain]Framed IP assigned to the user, if any.The @code{:nodomain} keyword suppresses the output of the domain part ofthe name, i.e. the hostname is displayed only up to the first dot.@end deffn @deffn {Format Spec} protocol @var{width} @var{title} [:empty @var{repl}][:right]Connection protocol as reported by @attr{Framed-Protocol} attribute.If the symbolic value is found in the dictionary file, it will bedisplayed. Otherwise, the numeric value will be displayed as is.@end deffn@deffn {Format Spec} time @var{width} @var{title} [:empty @var{repl}][:right][:format @var{date-format}]Date and time when the session started.The @code{:format} keyword introduces the @code{strftime} format stringto be used when converting the date for printing. The default value is@code{%a %H:%M}.@end deffn@deffn {Format Spec} duration @var{width} @var{title} [:empty @var{repl}][:right]Total time of the session duration.@end deffn@deffn {Format Spec} delay @var{width} @var{title} [:empty @var{repl}][:right]Delay time (@pxref{Acct-Delay-Time}).@end deffn@deffn {Format Spec} port-type @var{width} @var{title} [:empty @var{repl}][:right]Port type as reported by the value of the @attr{NAS-Port-Type} attribute.If the symbolic value is found in the dictionary file, it will bedisplayed. Otherwise, the numeric value will be displayed as is.@end deffn@deffn {Format Spec} clid @var{width} @var{title} [:empty @var{repl}][:right]The calling station @acronym{ID}.@end deffn@deffn {Format Spec} realm @var{width} @var{title} [:empty @var{repl}][:right][:nodomain]If the request was forwarded to a realm server, print the symbolic nameof the realm from the @file{raddb/realms} file. If no symbolic nameis found, print the remote server IP or hostname. In the latter case,the @code{:nodomain} keyword may be used to suppress the output of thedomain part of the name, i.e. to display the hostname only up to thefirst dot.@end deffn@comment *L2****************************************************************@node Predefined Formats@subsection @command{radwho} Predefined Formats@cindex @command{radwho}, predefined formatsThe predefined formats are:@table @samp@item defaultDefault output format. Each record occupies one line. The fields outputare: login name, @sc{gecos} name, connection protocol, port number, time whenthe connection was initiated, @NAS{} IP, and assigned framed IP. Thiscorresponds to the following format specification (split in severallines for readability:@smallexample(login 10 Login) (gecos 17 Name) \(protocol 5 Proto) (nas-port 5 TTY) \(time 9 When) (nas-address 9 From) \(framed-address 16 Location)@end smallexample@item sidThe same as @samp{default}, except that the session ID is output inthe second column.@item clidThe same as @samp{default}, except that the calling station ID is output inthe second column.@item longOutputs all information from each @file{radutmp} record. It isequivalent to specifying the following format string:@smallexample(login 32 Login) (session-id 32 SID) \(protocol 5 Proto) (nas-port 5 Port) \(time 27 Date) (nas-address 32 NAS) \(clid 17 CLID) (duration 7 Duration) \(framed-address 16 Location) (realm 16 Realm)@end smallexample@item gnuEach @file{radutmp} record is represented as a table. It isequivalent to specifying the following format string:@smallexampleUser: (login)(newline)\In real life: (gecos)(newline)\Logged in: (time)(newline)\NAS: (nas-address)(newline)\Port: (nas-port)(newline)\CLID: (clid)(newline)\Protocol: (protocol)(newline)\Session ID: (session-id)(newline)\Uptime: (duration)(newline)\Assigned IP: (framed-address)(newline)\Realm: (realm)(newline)"@end smallexample@end table
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -