fwtmp Command

Purpose

Manipulates connect-time accounting records by reading binary records in wtmp format from standard input and converting them to formatted ASCII records. You can use the ASCII version to edit bad records.

Syntax

/usr/sbin/acct/fwtmp [ -i ] [ -c ] [ -X ] [ -L ]

Description

The fwtmp command manipulates the accounting records by reading binary records in wtmp format from standard input and converting them to formatted ASCII records.

Flags

Item Description
-i Accepts ASCII records in the utmp format as input.
-c Converts output to utmp formatted binary records.
-ic Converts ASCII utmp formatted input records to binary output records.
-X Prints all available characters of each user name instead of truncating to the first 8 characters.
-L Prints all available characters of each host name instead of truncating to the first 32 characters.

Security

Access Control: These commands should grant execute (x) access only to members of the adm group.

Examples

  1. To convert a binary record in wtmp format to an ASCII record called dummy.file, enter:
    /usr/sbin/acct/fwtmp < /var/adm/wtmp > dummy.file
    The content of a binary wtmp file is redirected to a dummy ASCII file.
  2. To convert an ASCII dummy.file to a binary file in wtmp format called /var/adm/wtmp, enter the fwtmp command with the -ic switch:

    /usr/sbin/acct/fwtmp  -ic < dummy.file  > /var/adm/wtmp

    The dummy ASCII file is redirected to a binary wtmp file.

Files

Item Description
/usr/sbin/acct/fwtmp Contains the fwtmp command.
/var/adm/wtmp Contains records of date changes that include an old date and a new date.
/usr/include/utmp.h Contains history records that include a reason, date, and time.