大网数据广告活动
Windows Server 管理

How to Enable OpenSSH Verbose Logging

· 52CE 我爱测

Explains how to enable verbose logging for the OpenSSH service.

To enable verbose logging for the OpenSSH Server service, modify the sshd_config file, and restart the OpenSSH Server service. Follow these steps:

  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:

    # Logging
    #SyslogFacility AUTH
    #LogLevel INFO
    
  2. To enable verbose logging, edit the text to resemble the following excerpt:

    # Logging
    SyslogFacility AUTH
    LogLevel VERBOSE
    

    [!NOTE]
    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.

  3. Save and close the sshd_config file.

  4. To restart the OpenSSH Server service, open a Windows Command Prompt window, and then run the following command:

    NET STOP "OpenSSH SSH Server" && NET START "OpenSSH SSH Server"
    

After the service restarts, it generates verbose log data.

For more information about how to configure OpenSSH, see the Windows configurations in sshd_config section of "OpenSSH Server configuration for Windows Server and Windows."

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
- ✅ Supported versions of Windows Server - ✅ Supported versions of Windows Client · Source date 02/12/2026
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。