Enhance sftp protocol: get SHA hash of file

TJ Saunders tj at castaglia.org
Thu Jun 30 02:37:58 EST 2011


> it would be great, if the sftp protocol could be
> enhanced: get sha (or other hash value) from a file or part of a file.
> 
> This would make it possible to run a rsync like file transfer
> on sftp.
> 
> I would suggest a protocol like this
> 
> Client sends to Server:
> 
> get-supported hash-methods
> 
> returns whitespace seperated list like md5 sha1 sha256 ....
> 
> get-hash HASH-METHOD FILENAME STARTOFFSET BYTECOUNT
> 
> returns: hexlified hash value (all lowercase)
> 
> To get the hash value of the whole file: STARTOFFSET=0 and BYTECOUNT=0
> 
> Anyone interested?

Rather than reinventing the wheel, you might take a look at the (expired) 
Draft which proposed the "check-file-name" and "check-file-handle" SFTP 
extensions:

  http://tools.ietf.org/html/draft-ietf-secsh-filexfer-extensions-00

These extensions have been implemented by various SFTP clients and 
servers.

Cheers,
TJ

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   To spend too much time in studies is sloth.

   	-Francis Bacon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


More information about the openssh-unix-dev mailing list