Windows Server 2016 上的 SFTP,错误:从子进程获取 eof

问题描述 投票:0回答:2

尝试使用 FileZilla 连接到 Windows Server 2016 上的 SFTP 时,我收到“从子进程获取 eof”。调试跟踪如下。有谁知道为什么?还有补救办法吗?

备注:

    OpenSSH 正在服务器上运行
  1. 我可以使用 PuTTY 使用用户名和密码打开 SSH 会话
  2. 我可以使用 PuTTY 导航到文件夹(cd、dir 等)
  3. TLS1.x 由于其他安全原因被禁用,因此我无法使用“通过 TLS 的显式 FTP”
  4. 下面日志中的“xxx.xxx.xxx.xxx”是我出于安全原因编辑的IP
FileZilla 调试日志:

Status: Disconnected from server Trace: CControlSocket::DoClose(66) Trace: CControlSocket::ResetOperation(66) Trace: CFileZillaEnginePrivate::ResetOperation(66) Trace: CControlSocket::DoClose(66) Trace: CControlSocket::ResetOperation(66) Trace: CFileZillaEnginePrivate::ResetOperation(66) Trace: CControlSocket::DoClose(66) Trace: CControlSocket::ResetOperation(66) Trace: CFileZillaEnginePrivate::ResetOperation(66) Trace: CFileZillaEnginePrivate::ResetOperation(0) Trace: CControlSocket::SendNextCommand() Trace: CSftpConnectOpData::Send() in state 0 Status: Connecting to xxx.xxx.xxx.xxx... Trace: Going to execute C:\Program Files\FileZilla FTP Client\fzsftp.exe Response: fzSftp started, protocol_version=11 Trace: CSftpConnectOpData::ParseResponse() in state 0 Trace: CControlSocket::SendNextCommand() Trace: CSftpConnectOpData::Send() in state 3 Command: open "[email protected]" 22 Trace: Looking up host "xxx.xxx.xxx.xxx" for SSH connection Trace: Connecting to xxx.xxx.xxx.xxx port 22 Trace: We claim version: SSH-2.0-FileZilla_3.60.2 Trace: Connected to xxx.xxx.xxx.xxx Trace: Remote version: SSH-2.0-OpenSSH_for_Windows_8.9 Trace: Using SSH protocol version 2 Trace: Doing ECDH key exchange with curve Curve25519 and hash SHA-256 (SHA-NI accelerated) Trace: Server also has ecdsa-sha2-nistp256/rsa-sha2-512/rsa-sha2-256 host keys, but we don't know any of them Trace: Host key fingerprint is: Trace: ssh-ed25519 255 SHA256:+N7KuNqe4nd0Qq6EvuEDFsWX+EeLIkDN0SebsjsPITQ Trace: Initialised AES-256 GCM outbound encryption Trace: Initialised AES256 GCM outbound MAC algorithm (in ETM mode) (required by cipher) Trace: Initialised AES-256 GCM inbound encryption Trace: Initialised AES256 GCM inbound MAC algorithm (in ETM mode) (required by cipher) Status: Using username "myusername". Trace: Attempting keyboard-interactive authentication Trace: Server refused keyboard-interactive authentication Command: Pass: ************* Trace: Sent password Trace: Access granted Trace: Opening main session channel Trace: Opened main channel Trace: Started a shell/command Status: Connected to xxx.xxx.xxx.xxx Trace: Got eof from child process Trace: CControlSocket::DoClose(64) Trace: CControlSocket::ResetOperation(66) Trace: CSftpConnectOpData::Reset(66) in state 3 Error: Could not connect to server Trace: CFileZillaEnginePrivate::ResetOperation(66) Status: Waiting to retry... Trace: CControlSocket::DoClose(66) Trace: CControlSocket::ResetOperation(66) Trace: CFileZillaEnginePrivate::ResetOperation(66) Trace: CControlSocket::DoClose(66) Trace: CControlSocket::ResetOperation(66) Trace: CFileZillaEnginePrivate::ResetOperation(66) Trace: CControlSocket::SendNextCommand() Trace: CSftpConnectOpData::Send() in state 0 Status: Connecting to xxx.xxx.xxx.xxx... Trace: Going to execute C:\Program Files\FileZilla FTP Client\fzsftp.exe Response: fzSftp started, protocol_version=11 Trace: CSftpConnectOpData::ParseResponse() in state 0 Trace: CControlSocket::SendNextCommand() Trace: CSftpConnectOpData::Send() in state 3 Command: open "[email protected]" 22 Trace: Looking up host "xxx.xxx.xxx.xxx" for SSH connection Trace: Connecting to xxx.xxx.xxx.xxx port 22 Trace: We claim version: SSH-2.0-FileZilla_3.60.2 Trace: Connected to xxx.xxx.xxx.xxx Trace: Remote version: SSH-2.0-OpenSSH_for_Windows_8.9 Trace: Using SSH protocol version 2 Trace: Doing ECDH key exchange with curve Curve25519 and hash SHA-256 (SHA-NI accelerated) Trace: Server also has ecdsa-sha2-nistp256/rsa-sha2-512/rsa-sha2-256 host keys, but we don't know any of them Trace: Host key fingerprint is: Trace: ssh-ed25519 255 SHA256:+N7KuNqe4nd0Qq6EvuEDFsWX+EeLIkDN0SebsjsPITQ Trace: Initialised AES-256 GCM outbound encryption Trace: Initialised AES256 GCM outbound MAC algorithm (in ETM mode) (required by cipher) Trace: Initialised AES-256 GCM inbound encryption Trace: Initialised AES256 GCM inbound MAC algorithm (in ETM mode) (required by cipher) Status: Using username "myusername". Trace: Attempting keyboard-interactive authentication Trace: Server refused keyboard-interactive authentication Command: Pass: ************* Trace: Sent password Trace: Access granted Trace: Opening main session channel Trace: Opened main channel Trace: Started a shell/command Status: Connected to xxx.xxx.xxx.xxx Trace: Got eof from child process Trace: CControlSocket::DoClose(64) Trace: CControlSocket::ResetOperation(66) Trace: CSftpConnectOpData::Reset(66) in state 3 Error: Could not connect to server Trace: CFileZillaEnginePrivate::ResetOperation(66)
    
ssh sftp filezilla
2个回答
0
投票
连接到 Linux 机器时我遇到了“同样”的问题。

错误消息

    跟踪:
  • 从子进程中获取 eof
  • 跟踪:
  • CControlSocket::ResetOperation(66)
  • 跟踪:
  • CSftpConnectOpData::Reset(66),处于状态 3
具有零调试输出的 Filezilla 说:

Status: Connecting to server.net... Response: fzSftp started, protocol_version=11 ... Status: Connected to server.net Error: Fatal: unable to initialise SFTP on server: could not connect Error: Could not connect to server
在菜单中打开调试模式

FileZilla > Edit > Settings > Debug > Debug information in message log: 3-verbose


Status: Connecting to server.net... Response: fzSftp started, protocol_version=11 ... Status: Connected to server.net Error: Fatal: unable to initialise SFTP on server: could not connect Error: Could not connect to serverError: Fatal: unable to initialise SFTP on server: could not connect Trace: Got eof from child process Trace: CControlSocket::ResetOperation(66) Trace: CSftpConnectOpData::Reset(66) in state 3 Error: Could not connect to server

根本原因 从服务器发送的
欢迎消息对于SFTP协议而言太长

解决方案

就我而言,我最近创建了该消息,因此解决方案非常简单:使用 ssh
登录到远程服务器,并清除我的

~/.bashrc
文件生成的不必要的输出,我最近在其中设置了自定义欢迎消息,以在打开新 shell 后显示。

荣誉

感谢您访问 WinSCP 收到的太大 (... B) SFTP 数据包的帮助页面。支持的最大数据包大小为 102400 B


-1
投票

修复:

导航至:C:\ProgramData\
  1. 在记事本中打开“sshd_config”
  2. 找到“子系统”设置
  3. 将完整路径设置为特定于:“C:\Program Files\OpenSSH-Win64\sftp-server.exe”
  4. 保存文件
  5. 运行服务.msc
  6. 找到“OpenSSH SSH服务器”
  7. 右键单击并重新启动
# 覆盖无子系统的默认值 子系统 sftp "C:\Program Files\OpenSSH-Win64\sftp-server.exe"

© www.soinside.com 2019 - 2024. All rights reserved.