Defines the structures of certain user and accounting information files.
The structure of the records in the utmp, wtmp, and failedlogin files is defined in the /usr/include/utmp.h file. The utmp structure in this header file contains the following fields:
Embedded within the utmp structure is the exit_status structure, which contains the following fields:
e_termination | Termination status of a process. |
e_exit | Exit status of a process, marked as the DEAD_PROCESS value. |
ut_time | Time at which the entry was made. |
#ifndef -H-UTMP #define _H_UTMP #define UTMP_FILE "/etc/utmp" #define WTMP_FILE "/var/adm/wtmp" #define ILOG_FILE "/etc/.ilog" #define ut_name ut_user struct utmp { char ut_user[8]; /* User login name */ char ut_id[14] /* /etc/inittab */ char ut_line[12]; /* Device(console,lnxx) */ short ut_type; /* Type of entry */ pid_t ut_pid; /* Process ID */ struct exit_status { short e_termination; /* Process termination status */ short e_exit; /* Process exit status */ } ut_exit; /* The exit status of a process */ /* marked as DEAD_PROCESS. */ time_t ut_time; /* Time entry was made */ char ut_host[16]; /* hostname */ }; /* Definitions for ut_type */ #define EMPTY 0 #define RUN_LVL 1 #define BOOT_TIME 2 #define OLD_TIME 3 #define NEW_TIME 4 #define INIT_PROCESS 5 /* Process spawned by "init" */ #define LOGIN_PROCESS 6 /* A "getty" process */ /* waitingforlogin */ #define USER_PROCESS 7 /* A user process */ #define DEAD_PROCESS 8 #define ACCOUNTING 9 #define UTMAXTYPE ACCOUNTING /* Largest legal value */ /* of ut_type */ /* Special strings or formats used in the */ /* "ut_line" field when accounting for */ /* something other than a process. */ /* No string for the ut_line field can be more */ /* than 11 chars + a NULL in length. */ #define RUNLVL_MSG "run-level %c" #define BOOT_MSG "system boot" #define OTIME_MSG "old time" #define TIME_MSG "new time" #endif /* _H_UTMP */
Note: The who command extracts information from the /etc/utmp, /var/adm/wtmp, and /etc/security/failedlogin files.
This file is part of Accounting Services in AIX BOS Extensions 2.
/etc/utmp | The path to the utmp file, which contains a record of users logged in to the system. |
/var/adm/wtmp | The path to the wtmp file, which contains accounting information about logged-in users. |
/etc/security/failedlogin | The path to the failedlogin file, which contains a list of invalid login attempts. |
The getty command, init command, login command, who command, write command.
The utmp, wtmp, failedlogin file format.