ssh2
模块来传输文件,但是它依靠SFTP协议而不是纯SCP协议来复制文件。我需要将文件传输到支持SCP但 NOT SFTP的远程主机。
尝试使用任何依赖于ssh2
到我主机上的SCP文件的模块都会导致类似于以下错误:
Error: Received exit code 127 while establishing SFTP session
at Channel.onExit (/path/to/project/node_modules/ssh2/lib/client.js:904:19)
at Object.onceWrapper (events.js:300:26)
at Channel.emit (events.js:210:5)
at SSH2Stream.<anonymous> (/path/to/project/node_modules/ssh2/lib/Channel.js:210:14)
at SSH2Stream.emit (events.js:210:5)
at parse_CHANNEL_REQUEST (/path/to/project/node_modules/ssh2-streams/lib/ssh.js:4567:8)
at parsePacket (/path/to/project/node_modules/ssh2-streams/lib/ssh.js:3865:12)
at SSH2Stream._transform (/path/to/project/node_modules/ssh2-streams/lib/ssh.js:694:13)
at SSH2Stream.Transform._read (_stream_transform.js:189:10)
at SSH2Stream._read (/path/to/project/node_modules/ssh2-streams/lib/ssh.js:253:15) {
code: 127,
signal: undefined
}
是否存在一种使用不使用SFTP协议的Node将SCP文件发送到远程主机的方法?