scp命令 出现 subsystem request failed on channel 0 scp: Connection closed 的解决方法
因服务器端不支持SFTP传输协议,在有些新版本OpenSSH中默认采用SFTP传输协议,故发生以上错误。-O则是不使用SFTP而是SCP协议来传输文件,对于特定文件名通配符模式具有兼容性。windows向服务器复制数据,通过scp命令。增加参数-O来切换使用SCP传输协议。
·
windows向服务器复制数据
windows向服务器复制数据,通过scp命令
scp test.txt server@xx.xx.xx.xx:/abc
出现以下错误:
subsystem request failed on channel 0
scp: Connection closed
问题原因
因服务器端不支持SFTP传输协议,在有些新版本OpenSSH中默认采用SFTP传输协议,故发生以上错误
解决方案
增加参数-O来切换使用SCP传输协议
- scp命令中此参数说明
-O Use the legacy SCP protocol for file transfers instead of the SFTP protocol. Forcing the use of the SCP protocol may be necessary for servers that do not implement SFTP, for backwards-compatibility for particular filename wildcard patterns and for expanding paths with a ‘~’ prefix for older SFTP servers.
- 以上大意
-O 则是不使用SFTP而是SCP协议来传输文件,对于特定文件名通配符模式具有兼容性。
- 综上执行一下命令完美解决
scp -O test.txt server@xx.xx.xx.xx:/abc
参考
- https://www.cnblogs.com/0xcafebabe/p/17960208
- https://www.modb.pro/db/1703611922713235456
更多推荐
所有评论(0)