Go to the first, previous, next, last section, table of contents.


Utility Programs

Radwho

Radwho displays the list of users currently logged in by the Radius server.

Default output information is made compatible with that of the standard @UNIX{} finger(1) utility. For each user the following information is displayed: login name, name, connection protocol, NAS port, login date, NAS name, assigned IP address or corresponding network name.

When used with -l option, the long output format is used. In this format the following information is output:

`Login '
Login name of the user
`SessionID '
Unique session ID assigned by the terminal server.
`Proto '
Connection prototype.
`Port '
Port number
`When '
Login date and time
`From '
The name of NAS that accepted the connection.
`Location '
Framed IP address or the corresponding network name.
`Caller '
Caller station ID ad reported by the NAS.
`Duration '
Duration of the session.

Radwho Command Line Options

The following command line options can be used to modify the behavior of the program:

-A
--all
Display the information about logged-out users as well. The logged-out users are shown with Proto field set to HUP.
-c
--calling-id
Display the calling station ID in the second column.
-d NAME
--directory NAME
Set the radius configuration directory name.
-D {short|abbr|full}
--date-formap {short|abbr|full}
Set the date representation. By default dates are output as DOW HH:MM, where DOW means the day of week abbreviation, HH and MM mean hours and minutes respectively. This corresponds to option -D short. Other available formats are:
`abbr '
Abbreviated date: MM/DD HH:MM, where MM is a two-digit month number, DD -- a two-digit day of month.
`full '
Full data output, like this:
    Mon Dec 18 12:29:38 EET 2000
-e STRING
--empty STRING
Display any empty field as STRING. This is useful when the output of radwho is fed to some analyzing program, as it helps to keep the same number of columns on each line of output.
-F
--finger
Start in fingerd mode. In this mode radwho emulates the behavior of fingerd(8) utility. Use this option if starting radwho from the /etc/inetd.conf line like this:
    finger stream tcp nowait nobody /usr/sbin/radwho radwho -fL
This mode is also enabled by default if radwho notices that its name (argv[0]) is `fingerd' or `in.fingerd'.
-H
--no-header
Don't display header line.
-i
--session-id
Display session ID instead of GECOS in the second column.
-I {smart|ip|nodomain}
--ip-format {smart|ip|nodomain}
Change IP address representation. The meaning of the argument is as follows:
`smart '
Select the best representation. The following rules apply:
  1. For a NAS use its short name from `naslist'. If there is no short name, use its long name. If there is no long name either, go to 2.
  2. Resolve IP address to FQDN.
  3. If the IP cannot be resolved, use dotted-quad representation of the IP
`ip '
Display IP in dotted-quad form.
`nodomain '
If the IP can be resolved to a fully qualified domain name, use the hostname part of it, i.e. any characters up to the first dot.
-u
--local-also
Display information about local users from the system `utmp' file. May prove useful when running radwho as a finger daemon.
-n
--no-resolve
Do not resolve IP address. It is a synonym for -I ip.
-o FORMAT
--format FORMAT
Select customized output format. This can also be changed by setting the value of environment variable RADWHO_FORMAT. The format string is a comma-separated list of format specifications in one of the following forms:
field
Output field with its default width, heading and alignment. The field names and corresponding default values are discussed in detail below.
field:width
Output field, use column width width. If width starts with `+', the field will be right-aligned, if it starts with `-', the field will be left-aligned. Otherwise the default alignment will be used
field:width:heading
The same as above, but also supplies the heading for the column
The field names are:
login
Login name
orig
Original login name as supplied with the request.
port
NAS port number
sid
The Session ID
nas
The NAS name or IP address.
ip
Framed IP address assigned to the user, if it is provided framed service.
proto
Connection protocol. Its possible values are:
  • `PPP' for a point-to-point link
  • `SLIP' for a SLIP link
  • `HUP' for closed session
  • `shell' for shell user
date
Date/time when the session started
delay
Delay time section Acct-Delay-Time.
type
Entry type in decimal.
ptype
Port type. This is one of the following letters:
Type Meaning
`L' Local connection
`R' Rlogin connection
`S' SLIP connection
`C' CSLIP connection
`P' PPP connection
`A' Auto PPP connection
`E' Telnet session
`T' "Clear TCP" connection
`U' TCP login service
`!' Console session
`X' Shell
time
Total time of the session duration.
clid
The calling station ID.
uname
The GECOS field from local /etc/passwd, corresponding to the login name. If the user does not have a local account, his login name is output.
-s
--secure
Run in secure mode. Queries without a user name are rejected.

Radlast

The radlast utility lists sessions of specified users, NASes, NAS ports and hosts, in reverse time order. By default, each line of output contains the login name, NAS short name and port number from where the session was conducted, host IP address or name, the start and stop times for the session, and the duration of the session. If the session is still continuing, radlast will so indicate.

When specified the -l option, radlast produces long output. It includes following fields:

Radlast Command Line Options

Use following command line options to control the behavior of radlast utility:

-number
-c number
--count number
When given this option radlast will output at most this many lines of information.
-f
--file name
Read the specified file instead of the default `/var/log/radwtmp'.
-h hostname
--host hostname
Report the logins from given host. Host can be either a name or a "dotted quad" internet address.
-n shortname
--nas shortname
Report the logins from given Network Access Server (NAS).
-l
--long-format
"Long" output format. Report all the information stored in `radwtmp' file.
-p number
--port number
Report the logins on a given port. The port may be specified either fully or abbreviated, e.g. radlast -p 3 or radlast -p S03.
-s
--show-seconds
Report the duration of the login session in seconds instead of the default days, hours and minutes.
-t
The same as -p. This flag is provided for compatibility with last(1).
-w
--wide
Widen the duration field to show seconds as well as the default days, hours and minutes.

If multiple arguments are given, the logical OR operation between them is assumed, i.e. the information selected by each argument is printed. This, however, does not apply to -c option. This option is always combined with the rest of command line by logical AND.

The pseudo-user `~reboot' logs in on every reboot of network access server.

If radlast is interrupted, it indicates to what date the search was progressed.

Raduse

The raduse utility shows the usage of dialup lines in the realtime.

Display

At the top of output the summary information is displayed. It consists of two lines. First line shows the statistic collection uptime and current date/time. Second line shows total number of lines, number of active lines, number of idle (inactive) lines and load percentage.

The dialup statistics is displayed in the area below. For each dialup line three lines of data are shown.

First line shows the network access server name, port number on that server, number of logins registered on this line, status of the line, amount of time the line keeps the current status, and date and time where the line has switched to the current status.

If the line is currently active, the status field displays login name of the user logged in on this line. If the line is inactive, the word `[Idle]' is displayed.

Second and third lines display active and idle usage summary. They show following data: total time the line is in the given state, maximum amount of time in this state, and starting date and time when maximum duration was perceived.

The example of default display:

    uptime    90+20:35         Sun Dec 17 12:21                                    
    235 lines,  71 active, 164 idle. Pool load 0.30                                
                                                                                   
                                                                                   
    
    max          001  2796 [idle]                 00:05 Sun Dec 17 12:16           
                 43+00:17     1+22:39 Fri Sep 22 18:04 - 16:44                     
                 47+20:22       06:25 Thu Oct 05 02:24 - 08:50                     
    max          002  2877 [idle]                 00:09 Sun Dec 17 12:11           
                 41+06:56       10:55 Sat Oct 28 21:20 - 07:15                     
                 49+13:35       05:32 Mon Oct 02 00:33 - 06:05                     
    max          003  3000 [idle]                 00:08 Sun Dec 17 12:12           
                 39+14:42       19:44 Thu Nov 02 14:52 - 10:36                     
                 50+11:22       07:29 Wed Oct 11 23:30 - 06:59                     
    max          004  2829 jsmith                 00:05 Sun Dec 17 12:15           
                 41+21:11     1+00:04 Sun Sep 24 12:17 - 12:21                     
                 48+23:28       04:51 Sat Oct 07 03:42 - 08:33                     
    max          005  2913 gray                   00:41 Sun Dec 17 11:40           
                 40+12:01       15:24 Mon Dec 11 19:18 - 10:43                     
                 50+08:03       11:58 Wed Nov 29 13:43 - 01:41                     
    max          006  3014 roland                 00:39 Sun Dec 17 11:41           
                 42+02:10       22:28 Sun Sep 24 13:46 - 12:15                     
                 48+17:39       05:30 Fri Nov 24 01:57 - 07:28                     
    max          007  2937 [idle]                 00:06 Sun Dec 17 12:15           

This default display can be altered using command line options or interactive commands

Raduse Command Line Options

The following options modify the behavior of raduse:

-b
--brief
Start up in brief mode. In this mode only first line of information for each dialup line is displayed.
-d count
--display count
Show only count displays, then exit. A display is considered to be one update of the screen.
-D
--dump
Dump the statistics database to the standard output and then exit. This is for debugging purposes only.
-I
--no-idle-lines
Do not display idle lines. By default raduse displays all dialup lines.
-i
--interactive
Use interactive mode. In this mode any input is immediately read for processing. section Raduse Interactive Commands section for the description of commands usable in interactive mode. After processing each command the screen is updated immediately, no matter was the command understood or not. This mode is the default when the standard output is an intelligent terminal.
-n
--no-interactive
Use non-interactive mode.
-s num
--delay num
Specify delay in seconds between screen updates.
-w
--widen
Widen the time display fields to show the seconds.
-l
--list-nas
List the names and IP numbers of network access servers and then exit.
-h
--help
Display short usage summary.

Raduse Interactive Commands

The following commands are understood when raduse is in interactive mode. Some commands require an argument. Such commands are followed by the word arg. When raduse gets such command it displays a prompt and waits for user to enter the necessary data.

After processing each command the screen is updated immediately, no matter was the command understood or not.

RET
Refresh the screen immediately
SPC
Refresh the screen immediately
C-l
Clear and redraw the display.
^
(Caret) go to the first page.
b
Toggle brief display mode.
C-b
Move one page backwards.
C-f
Move one page forwards.
i
Toggle idle line display on or off.
j
Move one line forwards.
k
Move one line backwards.
G
$
Move to the last page.
q
Quit the program
s arg
Change the number of seconds to delay between screen updates.
t arg
Display lines on a given Network Access Servers. The user is prompted to input the NAS names. The names should be separated by whitespace. The word `all' returns to display of all NAS lines.

Radzap

radzap searches the Radius accounting database for matching login records and closes them.

At least one of -n, -p options or username must be specified. If they are used in conjunction, they are taken as if joined by logical AND operation.

`radzap' operates in two modes: silent and confirm. The silent mode is enabled by default. When run in this mode, radzap deletes every record that matched the search conditions given.

In confirm mode `radzap' will ask for a confirmation before zapping each matching record. Every line beginning with a `y' is taken as positive response, otherwise it is taken as negative response.

The confirm mode is toggled by the command line option -c.

Syntax

    radzap [options] [username]

Options are:

-c
--confirm
Enable confirm mode.
-q
--quiet
Disable confirm mode.
-h
--help
Display short help summary and exit.
-n NAME
--nas NAME
Specify NAS name to zap user from.
-p PORT
--port PORT
Specify the port number of the session to be zapped. The port number can be specified either in its full form, i.e radzap -p S02 or in its short form, like radzap -p 2.

Radgrep

This utility allows to quickly lookup the user in the radius accounting database using a regular expression match.

radgrep scans the output of radwho utility and outputs only the lines that match given regular expressions.

Syntax

radgrep accepts two sets of options separated by `--' (double-dash) sign. First subset is passed as command line to radwho utility. The second one is passed to grep.

Radping

This utility is a shell program that determines the user's framed IP address and runs ping on that address.

Syntax

    radping username
    radping -c calling-station-id

The second way of invoking the program allows to use calling station ID in order to indicate the user.

Radauth

The radauth utility sends the Radius server Access-Request packet and displays the result it gets. It can be used to test the configuration files. The usage is:

    raduse [-v] username password

The -v or --verbose option forces radauth to be verbose on output.

If you enter `.' (dot) instead of the password, the program will disable echoing on the screen, prompt you to enter the password, and turn the echoing on again, thus preventing the password from being compromised.

The program determines which Radius server to use, the authentication port number and shared secret following the procedure common for all client scripts (see section Client Configuration).

Radctl

Radctl is a control interface to radiusd daemon. It allows user running it to query radiusd about various aspects of its work and issue administrative commands to it.

    radctl -s command [args]

Where command is a command telling radctl which actions to take, and args are optional arguments to the command. Only one command can be specified per invocation.

The valid commands are as follows:

start [args]
If radiusd is not running already, it is started. When present, args are passed as the command line to the server.
stop
Stops running radiusd.
restart [args]
Stops the server and then starts it again. When present, args are passed as the command line to the server.
reload
Causes running radiusd server to re-read its configuration files.
dumpdb
Tells radiusd to dump its user hash table into the file `radlog/radius.parse'. This can be used for debugging configuration files.
status
radiusd reports its memory usage statistics. The information is logged under Info log level.
which
Reports the information about the running copy of radiusd.

Builddbm

Usage

Builddbm converts the plaintext Radius users database into DBM files. Some versions of Radius daemon have used this to speed up the access to the users database.

However, with GNU Radius things go the other way around. The server reads entire plaintext database, converts it into internal form and stores into hash table which provides for fast access. Actually, using DBM version of the users database slows down the access unless the machine which runs Radius daemon is short of address space for the daemon to store the users database into.

Syntax

When used without arguments, builddbm utility attempts to convert file `raddb/users' into `raddb/users.db' or `raddb/users.pag', `raddb/users.dir' pair, depending on the version of DBM library used.

If used with one argument, the argument is taken as the name of the plaintext database file to operate upon.

Use the following command line options to modify the operation of buildbm:

-d dir
Specifies alternate directory for the Radius configuration files. This defaults to `/usr/local/etc/raddb'.
-h
Outputs short usage summary and exits with 0 exit code.

Radscm: A guile interface to radius functions.

Radscm is a Scheme interpreter based on Guile with the addition of special functions and variables for communicating with radiusd. This chapter concentrates on the special features provided by radscm. Please refer to Guile documentation for information about Scheme and Guile See section `Overview' in The Guile Reference Manual.

Variables

Variable: %raddb-path
A path to radius configuration directory.

Function: rad-server-list
A list of radius servers. Each element of the list is:

    (list ID-STR HOST-STR SECRET-STR AUTH-NUM ACCT-NUM CNTL-NUM)

where:

ID-STR Server ID,
HOST-STR Server hostname or IP address,
SECRET-STR Shared secret key to use,
AUTH-NUM Authentication port number,
ACCT-NUM Accounting port number,
CNTL-NUM Control channel port number.

Thus, each entry can be used as an argument to rad-client-set-server or rad-client-add-server.

Functions

Function: rad-send-internal PORT-NUMBER CODE-NUMBER PAIR-LIST
Sends the request to currently selected server. Arguments are:

PORT-NUMBER
Port number to use. These values are allowed:
0 Authentication port,
1 Accounting port,
2 Control port.
The actual port numbers are those configured for the given server.
CODE-NUMBER
Request code.
PAIR-LIST
List of Attribute-value pairs. Each pair is either
            (cons ATTR-NAME-STR VALUE)
or
            (cons ATTR-NUMBER VALUE)

Return:

On success

            (list RETURN-CODE-NUMBER PAIR-LIST)

On failure:

            '()

Function: rad-send PORT-NUMBER CODE-NUMBER PAIR-LIST . VERBOSE
Sends a radius request. Actually it does the same work as rad-send-internal but if VERBOSE is specified, the verbose report about interaction with the radius server is printed.

Function: rad-client-list-servers
List currently configured servers. Two columns for each server are displayed: Server ID and IP address.

Function: rad-get-server
Returns the ID of the currently selected server.

Function: rad-client-set-server LIST
Selects for use the server described by LIST. A LIST should be:

    (list ID-STR HOST-STR SECRET-STR AUTH-NUM ACCT-NUM CNTL-NUM)

where:

ID-STR Server ID,
HOST-STR Server hostname or IP address,
SECRET-STR Shared secret key to use,
AUTH-NUM Authentication port number,
ACCT-NUM Accounting port number,
CNTL-NUM Control channel port number.

Function: rad-client-add-server LIST
Adds the server described by LIST to the list of active servers. A LIST should be:

    (list ID-STR HOST-STR SECRET-STR AUTH-NUM ACCT-NUM CNTL-NUM)

where:

ID-STR Server ID,
HOST-STR Server hostname or IP address,
SECRET-STR Shared secret key to use,
AUTH-NUM Authentication port number,
ACCT-NUM Accounting port number,
CNTL-NUM Control channel port number.

Function: rad-read-no-echo PROMPT-STR
Prints the given PROMPT-STR, disables echoing, reads a string up to the next newline character, restores echoing and returns the string entered. This is the interface to the C getpass(3) function.

Function: rad-client-source-ip IP-STR
Sets the IP address to be used as source. IP-STR can be either an IP address in dotted-quad form or a hostname.

Function: rad-client-timeout NUMBER
Sets the timeout for waiting to the server reply.

Function: rad-client-retry NUMBER
Sets the number of retries for sending requests to a radius server.

Function: rad-format-code DEST-BOOL CODE-NUMBER
Format a radius reply code into a human-readable form. DEST-BOOL has the same meaning as in format.

Function: rad-format-pair DEST-BOOL PAIR
Format a radius attribute/value pair for output. DEST-BOOL has the same meaning as in format. PAIR is either
                    (cons NAME-STR VALUE)

or

                    (cons ATTR-NUMBER VALUE)

where VALUE may be of any type appropriate for the given attribute.

Function: rad-print-pairs DEST-BOOL PAIR-LIST
Output the radius attribute/value pairs from the PAIR-LIST. DEST-BOOL has the same meaning as in format. PAIR-LIST is a list of pairs in the form

                    (cons NAME-STR VALUE)

or

                    (cons ATTR-NUMBER VALUE)

where VALUE may be of any type appropriate for the given attribute.

All "Reply-Message" pairs from the list are concatenated and displayed as one.

Function: rad-format-reply-msg PAIR-LIST . TEXT
Concatenate and print text from all "Reply-Message" pairs from the PAIR-LIST. If TEXT is specified, it is printed before the concatenated text.

Function: rad-list-servers
For each server from rad-server-list print its ID and hostname or IP address.

Function: rad-select-server ID-STR
Select the server identified by ID-STR as a current server. The server data are looked up in rad-server-list variable.

Function: rad-add-server ID-STR
Add the server identified by ID-STR to the list of current servers. The server data are looked up in rad-server-list variable.


Go to the first, previous, next, last section, table of contents.