我读过很多其他类似的问题,它们建议Subsystem sftp internal-sftp
在 sshd_config 中进行设置,我照做了。我能够正常通过 SSH 连接到我的远程计算机,但 SFTP 无法登录。这一切都始于我在服务器上为 Duo 设置双因素身份验证。当我输入sftp -v HostName
对应于 中设置的主机时~/.ssh/config
,终端挂起,等待我在手机上批准登录请求。之后,日志会打印一堆内容。
日志显示我的密钥已被接受:Authentication succeeded (publickey)
然后它以 退出Exit status 127
。以下是其余的日志输出,以防相关。
debug1: Authentication succeeded (publickey).
Authenticated to 192.168.1.136 ([192.168.1.136]:22).
debug1: channel 0: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype [email protected] want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending subsystem: sftp
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype [email protected] reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 2732, received 2572 bytes, in 5.5 seconds
Bytes per second: sent 493.6, received 464.7
debug1: Exit status 127
Connection closed
我想重申一下,在设置 Duo 之前,使用密钥登录 SFTP 的过程运行良好,但现在似乎只有 SFTP 出现问题。有什么想法吗?