我正在使用从https://github.com/PowerShell/Win32-OpenSSH/releases下载的 OpenSSH 。
我的目标是设置一个 ssh 服务器,允许 sftp 文件传输而无需 ssh 访问。根据OpenSSH提供的官方文档,Windows从7.7版本开始应该支持这一点。已发布,应该在 sshd_config 中设置限制,我尝试使用该文件一段时间,但我无法限制自己只能访问子文件夹,这就是我的配置文件中的内容添加:
Subsystem sftp sftp-server.exe
ForceCommand internal-sftp
ChrootDirectory c:\users\myusername
AllowTcpForwarding no
PermitTunnel no
GatewayPorts no
Run Code Online (Sandbox Code Playgroud)
谁能告诉我为什么这不起作用?或者我不能像这样设置 SFTP 访问?
另一种选择是禁用 SSH 连接。如何在 Windows 中使用 OpenSSH 实现这一目标?