【问题标题】:How to generate Windows OpenSSH default config file? [closed]如何生成 Windows OpenSSH 默认配置文件? [关闭]
【发布时间】:2021-07-16 07:49:56
【问题描述】:

我想知道默认的 OpenSSH 配置文件(Linux 的“sshd_config”)在哪里,或者如果不存在如何生成该文件。

我认为 SSH 设置文件“sshd_config”和“config”是相同的格式和相同的文件,但显然它们不是。因为我将C:\Windows\System32\OpenSSH\sshd_config_default 复制并粘贴到C:/Users/user/.ssh/config 并且我没有工作,我得到一个错误它说格式无效:

PS C:\Users\tmp> ssh user@192.168.0.123
C:\\Users\\tmp/.ssh/config: line 38: Bad configuration option: authorizedkeysfile
C:\\Users\\tmp/.ssh/config: line 76: Bad configuration option: subsystem
Unsupported Match attribute Group
C:\\Users\\tmp/.ssh/config line 84: Bad Match condition

所以,我想知道 Windows OpenSSH 默认配置文件是什么样的。在不知情的情况下,我不知道也无法更改行来更改 SSH 设置。

【问题讨论】:

    标签: windows ssh openssh


    【解决方案1】:

    PowerShell/Win32-OpenSSH issue 1297之后,你应该简单地修改C:\Windows\System32\OpenSSH\sshd_config_default然后重启SSH服务。

    无需在别处复制/重命名(除了,可能是,保留原始版本)

    %USERPROFILE%\.ssh\config 文件仅在客户端使用,SSH 服务器/服务不使用。

    如“Unable to get public-key login to work on Windows 10 ssh server”中所述,sshd_config 可以添加到:

    C:\ProgramData\ssh\sshd_config
    

    【讨论】:

    • 它没有解决问题。我尝试编辑 sshd_config_default 但出现错误并且无法保存文件。我google了一下,发现有人说不是C:\Windows\System32\OpenSSH\sshd_config_default,而是配置文件是C:\ProgramData\ssh\sshd_config。
    • 好的。我想它必须通过管理员会话进行修改(CMD 以管理员身份打开)
    • @pupsozeyde 我找到了配置文件的路径,但我看到你在下一个问题中已经提到了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-08-16
    • 2013-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-18
    相关资源
    最近更新 更多