It is possible to use SCP under SSH2? and if this is the case, where can
I
find the SCP protocol? I understand that the protocol is in fact, RCP
protocol, but also I have not being able to find it....
SCP is done over a "session"/"exec" channel (with the assumption that
the "scp" command will be in the remote path. Check OpenSSH's source
for the specific conversation language.
Generally for receiving files it's:
exec: "scp -pf /path/to/file"
C: \0 (Literally, send a null byte)
S: T 99999 99999 99999 999999 (mtime.sec mtime.usec atime.sec
atime.usec)
C: \0
S: C 0999 99999999 SSSSS (mode[octal] filelen basename)
C: \0
S: XXXXXXXXXXXXXXX (File Data, <filelen> bytes)
Sending is the same conversation with roles reversed
exec: "scp -pt /path/to/file"
S: \0 (Literally, send a null byte)
C: T 99999 99999 99999 999999 (mtime.sec mtime.usec atime.sec
atime.usec)
S: \0
C: C 0999 99999999 SSSSSS (mode[octal] filelen basename)
S: \0
C: XXXXXXXXXXXXXXX (File Data, <filelen> bytes)
In both cases, if the 'p' is ommitted from the options then
mtime/atime is not sent.