|
| 1 | +--- |
| 2 | +title: How to Enable OpenSSH Verbose Logging |
| 3 | +description: Explains how to enable verbose logging for the OpenSSH service. |
| 4 | +ms.date: 10/07/2025 |
| 5 | +manager: dcscontentpm |
| 6 | +audience: itpro |
| 7 | +ms.topic: troubleshooting |
| 8 | +ms.reviewer: kaushika, warrenw, v-appelgatet |
| 9 | +ms.custom: |
| 10 | +- sap:system management components\openssh (including sftp) |
| 11 | +- pcy:WinComm User Experience |
| 12 | +appliesto: |
| 13 | + - ✅ <a href=https://learn.microsoft.com/windows/release-health/windows-server-release-info target=_blank>Supported versions of Windows Server</a> |
| 14 | + - ✅ <a href=https://learn.microsoft.com/windows/release-health/supported-versions-windows-client target=_blank>Supported versions of Windows Client</a> |
| 15 | +--- |
| 16 | +# How to enable OpenSSH verbose logging |
| 17 | + |
| 18 | +To enable logging verbose logging for the OpenSSH Server service, modify the sshd_config file, and restart the OpenSSH Server service. Follow these steps: |
| 19 | + |
| 20 | +1. Use an administrator-level account to open a text editor, and then open **%ProgramData%\ssh\sshd_config**. The default text of the "Logging" section should resemble the following excerpt: |
| 21 | + |
| 22 | + ```output |
| 23 | + # Logging |
| 24 | + #SyslogFacility AUTH |
| 25 | + #LogLevel INFO |
| 26 | + ``` |
| 27 | + |
| 28 | +1. To enable verbose logging, edit the text to resemble the following excerpt: |
| 29 | + |
| 30 | + ```output |
| 31 | + # Logging |
| 32 | + SyslogFacility AUTH |
| 33 | + LogLevel VERBOSE |
| 34 | + ``` |
| 35 | + |
| 36 | + > [!NOTE] |
| 37 | + > By default, the OpenSSH Server service sends logs to Windows Event Viewer. To record a log file instead, use `SyslogFacility LOCAL0` instead of `SyslogFacility AUTH` in sshd_config. The OpenSSH service records log files in %ProgramData%\ssh\logs. |
| 38 | +
|
| 39 | +1. Save and close the sshd_config file. |
| 40 | + |
| 41 | +1. To restart the OpenSSH Server service, open a Windows Command Prompt window, and then run the following command: |
| 42 | + |
| 43 | + ```console |
| 44 | + NET STOP "OpenSSH SSH Server" && NET START "OpenSSH SSH Server" |
| 45 | + ``` |
| 46 | + |
| 47 | +After the service restarts, it generates verbose log data. |
| 48 | + |
| 49 | +For more information about how to configure OpenSSH, see the [Windows configurations in sshd_config](/windows-server/administration/OpenSSH/openssh-server-configuration#windows-configurations-in-sshd_config) section of "OpenSSH Server configuration for Windows Server and Windows." |
0 commit comments