Event ID 4: sshd informational message (logons, failures, service start)
Windows OpenSSH writes every informational message as event 4 in OpenSSH/Operational. The event has no structured logon fields: the user, source address, port and method are inside the payload text, in the same wording as a Linux sshd log line.
- Channel
- OpenSSH/Operational
- Logged by default
- No
- Written on
- Target host
- Volume
- Moderate
- Provider
- OpenSSH
- Needs a SACL
- No
To have this event
- OpenSSH Server installed (an optional feature on most Windows versions) and the sshd service running
- sshd logging to the event log, which is the default. SyslogFacility LOCAL0 in sshd_config sends it to %ProgramData%\ssh\logs instead
Key fields
Exact XML field names, as they appear in <Data Name="…"> and in SIEM field extractions.
| Field | What it tells you |
|---|---|
| process | OpenSSH program that wrote the message, for example sshd. Releases based on OpenSSH 9.8 or later split connection handling into sshd-session, which may appear here instead |
| payload | The message text, for example 'Accepted password for <user> from <ip> port <port> ssh2', 'Accepted publickey for <user> from <ip> port <port> ssh2: <key type> SHA256:<fingerprint>', 'Failed password for [invalid user] <user> from <ip> port <port> ssh2', 'Invalid user <user> from <ip> port <port>' or 'Server listening on 0.0.0.0 port 22.' |
Analyst notes
- 01Event 4 is generic, so filter on the payload text, not the ID: 'Accepted' lines are successful logons, 'Failed password' and 'Invalid user' lines are failures, and 'Server listening on' marks sshd starting, which on a host that should not run SSH means someone enabled it.
- 02At the default LogLevel INFO, successful logons and failed password attempts are recorded, but failed public key attempts are usually only logged at LogLevel VERBOSE. Check %ProgramData%\ssh\sshd_config before concluding there were no key-based attempts.
- 03For an 'Accepted publickey' line, match the SHA256 fingerprint to the keys in the user's .ssh\authorized_keys or, for administrators, %ProgramData%\ssh\administrators_authorized_keys. A key added there is a persistence method.
- 04Correlate with Security 4624 for the same account and time, and, where OpenSSH appeared recently, with the sshd service install (System 7045) and a firewall rule for port 22 (Firewall 2004).
Pull this event
Retrieval queries for a live host, a collected .evtx file and common SIEMs. Filter further on the key fields above.
Get-WinEvent -LogName 'OpenSSH/Operational' -FilterXPath "*[System[(EventID=4)]]" -MaxEvents 50 |
Select-Object TimeCreated, Id, MachineName, Message-FilterXPath supports exact matches only. For substring matching, filter in Where-Object.
ATT&CK mapping
Techniques this event can help detect. Most of these depend on specific field values; the event alone does not mean the technique happened.
Also relevant, depending on field values
Related events
Common questions
- What does Windows event ID 4 mean?
- Windows OpenSSH writes every informational message as event 4 in OpenSSH/Operational. The event has no structured logon fields: the user, source address, port and method are inside the payload text, in the same wording as a Linux sshd log line. It is written to the OpenSSH Operational log (OpenSSH/Operational).
- Is event 4 logged by default?
- No. It must be enabled before it is recorded.
- Where is event 4 recorded?
- In the OpenSSH/Operational channel on the target host.
Decode a real event
Paste the XML and every value gets explained. Nothing leaves your browser.
Open decoderWindows OpenSSH writes every informational message as event 4 in OpenSSH/Operational. The event has no structured logon fields: the user, source address, port and method are inside the payload text, in the same wording as a Linux sshd log line.