sftp 连接不上,调试信息显示如下:
debug1: client_input_global_request: rtype hostkeys-00@openssh.com 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 eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
Transferred: sent 1756, received 2336 bytes, in 0.1 seconds
Bytes per second: sent 30524.8, received 40607.0
debug1: Exit status 127
查看 sshd_config 配置文件, 发现没有/usr/libexec/sftp-server可执行程序
# override default of no subsystems
Subsystem sftp /usr/libexec/sftp-server
可以修改如下:
# override default of no subsystems
Subsystem sftp internal-sftp
之后提示正常连接。
sftp-server 与 internal-sftp 的区别可看
https://serverfault.com/questions/660160/openssh-difference-between-internal-sftp-and-sftp-server