Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: where can I find SCP protocol document?

Fan Xu wrote:

SCP protocols for SSHv1 and SSHv2 are different. I figured it out for SSHv1 by looking at the code. It seems to me it is very difficult to do the same thing for SSHv2.

AFAIK there is no protocol SCP2, there is only client called scp2. SCP2 is in fact SFTP. You can find links to different version of SFTP specification on this site in section Supported transfer protocols.

I have just found comprehensive explanation in post by Simon Tatham on comp.security.ssh:
The traditional scp, which I'll refer to as scp1, is a program which
expects to talk to another copy of itself. So it works by opening an
SSH connection to the server using your local SSH client program,
and then invoking the scp1 binary at the other end. Then the two scp
programs talk to each other and transfer files. Hence, scp1 _can_
work over the SSH2 protocol just as easily as SSH1 - it doesn't even
notice the difference when it invokes the SSH client. The reason it
often doesn't work if you're using ssh.com's product is that they
don't ship the scp1 binary with their SSH2 product - so although the
SSH2 connection is made successfully, the transfer then fails
because the scp binary is unavailable at the far end.

There's a second file transfer protocol available in SSH2 called
SFTP. This is a more general protocol and lends itself to proper GUI
clients, FTP-like command-line clients and probably all sorts of
other interesting types of client as well; ssh.com's `scp2' program
has practically nothing to do with scp1 at all, but is a special-
purpose client for the SFTP protocol. Hence you can't use that to
talk to an SSH1 server at all, because there's no way to invoke SFTP
over an SSH1 connection.

OpenSSH support SFTP in their server, but don't use it in their SCP
client. Instead they just continue to run the scp1 program, over an
SSH1 or SSH2 connection whichever is available. So the upshot of all
this is:

- You can scp from an ssh.com scp2 client to an OpenSSH server, and
it will use SFTP and work.

- You can use any scp1 client to talk to an OpenSSH server and it
will work.

- If you try to use OpenSSH's scp client to talk to an ssh.com
server it will fail, unless you've deliberately installed the
scp1 program at the server end for backwards compatibility. But
once you do that, you _can_ speak scp1 over SSH2.

I think a proper SCP client should be able to speak both the scp1
and SFTP protocols, and use whichever is available. This is what
PuTTY's one does.

The post is almost two years old and I think that it is not accurate as of now. I believe that even OpenSSH does not ship scp1 for ssh2 now. Also you may use even SFTP with SSH1. Both WinSCP and PSCP (by Simon) allows it. You just cannot run the SFTP server as subsystem, because only SSH2 has subsystems. You need to run SFTP server the way you run SCP on remote side.
Fan Xu

Re: where can I find SCP protocol document?

martin wrote:

I have never been able to find any documentation/specification of SCP protocol. I have learned it from unix source code. If you find any docs, please send me a link. Also, what do you mean by SCP over SSH2? SCP is just one, I believe. For SSH2 it is better to use SFTP, which is generaly available with it.



SCP protocols for SSHv1 and SSHv2 are different. I figured it out for SSHv1 by looking at the code. It seems to me it is very difficult to do the same thing for SSHv2.
martin

Re: where can I find SCP protocol document?

I have never been able to find any documentation/specification of SCP protocol. I have learned it from unix source code. If you find any docs, please send me a link. Also, what do you mean by SCP over SSH2? SCP is just one, I believe. For SSH2 it is better to use SFTP, which is generaly available with it.
Fan Xu

where can I find SCP protocol document?

Hi,

Where can I find SCP document, especially with SCP over SSHv2.

Thanks in advance!

Fan