SCP(安全复制协议)文件传输如何工作? [英] How is SCP (secure copy protocol) file transfer working?
问题描述
请告诉我SCP的工作原理.
Please, tell me how does the SCP work.
任何人都可以向我解释(或显示)SCP文件的传输(看起来像图片,流程或参考).
SCP和SFTP文件传输之间有什么区别?
Can anybody explain(or show) SCP file transfer to me (something looks like picture, flow or reference).
What were the differences between SCP and SFTP file transfer?
先谢谢您,对我的语言感到抱歉.
Thanks in advance, and sorry about my language.
推荐答案
SCP客户端连接到SSH服务器并在其中执行scp
命令.在大多数情况下,远程scp
将是OpenSSH scp
命令.这意味着,如果您将OpenSSH scp
命令用作客户端,则本地scp
(作为客户端)实际上与服务器上的同一程序对话.远程scp
是使用未记录的-t
(至)或-f
(自)标志执行的.通过这种方式,scp
程序将其识别为服务器.
The SCP client connects to the SSH server and executes scp
command there. In most cases, the remote scp
would be the OpenSSH scp
command. That means, if you use the OpenSSH scp
command as a client, the local scp
(as a client) actually talks to the same program on the server. The remote scp
is executed with undocumented -t
(to) or -f
(from) flags. This way, the scp
program recognizes that it serves as a server.
一旦远程scp
运行,它将使用简单的协议与本地SCP客户端(scp
或其他实现)进行通信.
Once the remote scp
is running, it talks with the local SCP client (the scp
or another implementation) using a simple protocol.
SCP命令是一个字母,后跟一些自变量和换行符.
An SCP command is one-letter followed by some arguments and new-line.
SCP响应为一个字节,其中0x00
=正常,0x01
=错误,0x02
=致命错误(尽管OpenSSH scp
实际上从不响应0x02
).错误代码之后是错误消息(以换行符终止).
An SCP response is one byte, with 0x00
= ok, 0x01
= error, 0x02
= fatal error (though the OpenSSH scp
actually never responds with 0x02
). The error code is followed by an error message (terminated with a new-line).
总是由源端来提供命令.目标方消耗它们. IE.在下载时,服务器会提供命令,而客户端会使用它们.上载时,客户端会提供命令,而服务器会使用它们.
It's always the source side that feeds the commands. The target side consumes them. I.e. when downloading, the server feeds the commands and the client consumes them. When uploading, the client feeds the commands and the server consumes them.
命令是:
-
E
–退出 -
T
–为即将到来的文件设置时间戳 -
C
–文件传输 -
D
–目录
E
– exitT
– sets timestamps for the upcoming fileC
– file transferD
– directory
另请参见在JSch库中实施SCP协议的说明.
这篇关于SCP(安全复制协议)文件传输如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!