IBM Support

Tracking User Connection Activity on IBM i

How To


Summary

Monitoring successful user connections is an essential security and auditing requirement on IBM i, particularly for highly privileged user profiles such as QSECOFR. Visibility into when a user connects, how the connection is established, and which system services are involved is critical for security reviews, forensic investigations, and compliance audits.

This document describes a supported, SQL-based approach to tracking successful user connections by analyzing job start audit journal entries. The solution leverages IBM i Services and does not require exit programs, triggers, or permanent database objects.

Objective

The objectives of this document are to identify successful connections for a specific user profile, track the start of user-related jobs, and determine the connection method based on job attributes and system server jobs. The examples focus on user a specific user profile V6CASTIL but can easily be adapted for other profiles.

Environment

The following conditions must be met in order to capture and report on successful connections:

  • The system audit journal (QAUDJRN) must be active
  • QAUDLVL and/or QAUDLVL2 must include *JOBDAT or *JOBBAS job auditing values
  • Audit journal receivers must be retained for the reporting period

IBM i Service Used:

All examples in this document use the SYSTOOLS.AUDIT_JOURNAL_JS table function. This service returns JS (Job Change) audit journal entries and provides sufficient metadata to identify successful connections and infer the access method.

If auditing was not enabled at the time of the connection, historical activity cannot be reconstructed.

Warning: 

The IBM i operating system does not explicitly track successful sign-on events. Instead, audit journal entries recorded under the auditing values *JOBDAT and/or *JOBBAS track the lifecycle of a job. Using this data, it is possible to identify when jobs start, swapping or servicing a user profile, and ending. This document explains how to interpret audit journal data to identify jobs that are servicing a user, but it does not provide confirmation of a successful sign-on event.

Steps

Step 1: Identify Server Connections Specific User:

Successful user connections result in job creation. JS entries are written only when a job successfully starts. IBM i does not explicitly record the access method as a single attribute. Instead, connection type is inferred using job attributes such as job type, job subtype, and job name. This method aligns with IBM Support guidance and internal diagnostic procedures.

Using the Run SQL Scripts tool, run the statement:  

SELECT ENTRY_TIMESTAMP AS JOB_EVENT_TIME,
       USER_NAME,
       JOB_NAME,
       JOB_TYPE,
       REAL_USER_PROFILE,
       ENTRY_TYPE,
       CASE
           WHEN ENTRY_TYPE = 'S' THEN 'Start'
           WHEN ENTRY_TYPE = 'E' THEN 'End'
           WHEN ENTRY_TYPE = 'M' THEN 'Change profile or group profile'
           ELSE 'Other'
       END AS JOB_EVENT_TYPE,
       CASE
           WHEN JOB_TYPE = 'INT' THEN '5250 / Telnet (Non-Secure unless SSL/Telnet configured)'
           WHEN JOB_NAME LIKE 'QZDASOINIT%' THEN 'ODBC / JDBC (Non-Secure)'
           WHEN JOB_NAME LIKE 'QZDASSINIT%' THEN 'ODBC / JDBC (Secure SSL/TLS)'
           WHEN JOB_NAME LIKE 'QTFTP%' THEN 'FTP (Non-Secure)'
           WHEN JOB_NAME LIKE 'QSSHD%' THEN 'SFTP (Secure SSH)'
           WHEN JOB_NAME LIKE 'QRWTSRVR%' THEN 'Remote SQL (Secure depends on configuration)'
           WHEN JOB_NAME LIKE 'QZRCSRVS%' THEN 'Remote Command (Secure depends on configuration)'
           WHEN JOB_NAME LIKE 'QP0ZSPWP%' THEN 'SSH / Spawned Process (Secure)'
           WHEN JOB_NAME LIKE 'QHTTPSVR%' THEN 'Web (HTTP or HTTPS - verify server config)'
           WHEN JOB_NAME LIKE 'QZLSFILE%' THEN 'Mapped Drive (Secure depends on NetServer config)'
           WHEN JOB_NAME LIKE 'QPWFSERVSO%' THEN 'File Server Job (Secure depends on config)'
           ELSE 'Other Host Server (Security Unknown)'
       END AS CONNECTION_TYPE,
       REMOTE_ADDRESS
    FROM TABLE (
            SYSTOOLS.AUDIT_JOURNAL_JS(STARTING_TIMESTAMP => CURRENT_TIMESTAMP - 7 DAYS)
        ) AJ
    WHERE REAL_USER_PROFILE = 'V6CASTIL' -- Update the User profile ID in all uppercase letters
          AND ENTRY_TYPE IN ('S', 'E', 'B', 'M')
          AND REAL_USER_PROFILE NOT IN ('QCTP', 'QUSER')
    ORDER BY JOB_EVENT_TIME DESC;

 

Notes for SQL:

  • This query returns results for the user profile V6CASTIL; update the REAL_USER_PROFILE filter as needed to report on other users.  

  • The User Profile ID must be specified in all upper case letters.

  • Adjust the timestamp filter as needed; it is currently configured to display data from the last seven days.

 

Notes for Interpreting the Results

  • This query does not identify successful sign-on events.
    IBM i does not record a discrete audit entry for a successful sign-on. The results reflect job lifecycle activity recorded by auditing, not authentication success.

  • Each row represents a job‑related audit event, not a user session.
    Multiple rows may be produced for a single connection due to job start, job reuse, profile swaps, or job termination.

  • JOB_EVENT_TYPE indicates how the job is changing state, not user intent:

    • Start (ENTRY_TYPE = 'S') indicates a job was started.
    • End (ENTRY_TYPE = 'E') indicates a job ended.
    • Change profile or group profile (ENTRY_TYPE = 'M') indicates job profile swapping or group profile changes.
    • These events may or may not correspond to an interactive user action.
  • REAL_USER_PROFILE identifies the profile being serviced, not necessarily the job owner.

    • This is especially important for server jobs that reuse or swap to different user profiles.
    • Profile changes (M entries) indicate user context changes within the same job.
  • CONNECTION_TYPE is inferred from job naming conventions, not explicitly recorded by IBM i.

    • Classification is based on well-known IBM i server job patterns (for example, QSSHD% for SFTP/SSH).
    • Custom or third‑party server jobs may appear as “Other Host Server.”
  • Multiple connection types may appear for the same user within the time period.

    • This does not imply simultaneous access.
    • Host server jobs are often reused across sessions.
  • REMOTE_ADDRESS shows the network endpoint associated with the job event, when available.

    • Not all job lifecycle events include a remote address.
    • For reused jobs, the address may reflect the most recent connection.
  • Ordering by JOB_EVENT_TIME shows the most recent activity first, which helps identify:

    • Ongoing or recent job servicing activity
    • Profile reuse patterns
    • Session termination order
  • Absence of a job end event does not necessarily indicate an active session.

    • Server jobs may remain active and later be reused for another user.
  • This query is best used for activity analysis and correlation, such as:

    • Identifying when a user profile was serviced by a job
    • Associating job activity with network addresses
    • Supporting audit or security investigations  It should not be used as authoritative proof of user sign-on or logon success.

 

Sample Report:

JOB_EVENT_TIMEUSER_NAMEJOB_NAMEJOB_TYPEREAL_USER_PROFILEENTRY_TYPEJOB_EVENT_TYPECONNECTION_TYPEREMOTE_ADDRESS
4/9/2026 7:07V6CASTILQP0ZSPWPBCIV6CASTILEEndSSH/Spawned Process 
4/9/2026 7:07V6CASTILQP0ZSPWPBCIV6CASTILSStartSSH/Spawned Process 
4/9/2026 7:07V6CASTILQP0ZSPWPBCIV6CASTILMChange profile or group profileSSH/Spawned Process172.16.3.250
4/9/2026 7:02V6CASTILQZRCSRVSPJV6CASTILEEndWEB/ Remote Command 
4/8/2026 15:47V6CASTILQZRCSRVSPJV6CASTILMChange profile or group profileWEB /Remote Command172.16.3.250
4/8/2026 15:47V6CASTILQZRCSRVSPJV6CASTILMChange profile or group profileRemote Command172.16.3.250
4/8/2026 15:47V6CASTILQZDASOINITPJV6CASTILMChange profile or group profileODBC / JDBC172.16.3.250
4/8/2026 15:47V6CASTILQZSOSIGNPJV6CASTILMChange profile or group profileOther Host Server172.16.3.250
4/8/2026 15:47V6CASTILQZSOSIGNPJV6CASTILMChange profile or group profileOther Host Server172.16.3.250
4/8/2026 13:25V6CASTILQZRCSRVSPJV6CASTILEEndRemote Command 
4/8/2026 11:45V6CASTILQZRCSRVSPJV6CASTILMChange profile or group profileRemote Command172.16.3.250
4/8/2026 11:45V6CASTILQZRCSRVSPJV6CASTILMChange profile or group profileRemote Command172.16.3.250
4/8/2026 11:45V6CASTILQZDASOINITPJV6CASTILMChange profile or group profileODBC / JDBC172.16.3.250
4/8/2026 11:24V6CASTILQPWFSERVSOPJV6CASTILMChange profile or group profileFile Server Job172.16.3.250
4/8/2026 11:24V6CASTILQZRCSRVSPJV6CASTILMChange profile or group profileRemote Command172.16.3.250
4/8/2026 11:24V6CASTILQZRCSRVSPJV6CASTILMChange profile or group profileRemote Command172.16.3.250
4/8/2026 11:24V6CASTILQZRCSRVSPJV6CASTILEEndRemote Command 
4/8/2026 8:32V6CASTILQZRCSRVSPJV6CASTILMChange profile or group profileRemote Command172.16.3.250
4/8/2026 8:32V6CASTILQZRCSRVSPJV6CASTILMChange profile or group profileRemote Command172.16.3.250
4/8/2026 8:32V6CASTILQZSOSIGNPJV6CASTILMChange profile or group profileOther Host Server172.16.3.250
4/8/2026 8:32V6CASTILQPADEV003GINTV6CASTILSStart5250 / Telnet172.16.3.250
4/8/2026 8:32V6CASTILQZRCSRVSPJV6CASTILEEndRemote Command 
4/8/2026 8:32V6CASTILQZRCSRVSPJV6CASTILMChange profile or group profileRemote Command172.16.3.250
4/8/2026 8:32V6CASTILQZRCSRVSPJV6CASTILMChange profile or group profileRemote Command172.16.3.250
4/8/2026 8:32V6CASTILQZSOSIGNPJV6CASTILMChange profile or group profileOther Host Server172.16.3.250
4/8/2026 8:32V6CASTILQZSOSIGNPJV6CASTILMChange profile or group profileOther Host Server172.16.3.250

 

Summary:

By using the AUDIT_JOURNAL_JS service, administrators can reliably track successful user connections and identify how those connections were established. This approach is fully supported, non-intrusive, and aligns with IBM i security and auditing best practices.

 

 

 

 

Document Location

Worldwide

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHyAAM","label":"Security"}],"ARM Case Number":"TS021932286","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"and future releases;7.3.0;7.4.0;7.6.0"}]

Document Information

Modified date:
13 May 2026

UID

ibm17269032