0

I am connecting to a remote host via SFTP to transfer files.

Is it possible to determine the hash of a file on the remote host, without downloading it first? If so how?

jim
  • 8,670
  • 15
  • 78
  • 149

1 Answers1

0

As you are using SFTP, then you should also have SSH access to this machine, as SFTP is FTP on top of SSH.

This means that you should be able to execute remote commands on this machine - try some of the approaches mentioned here: How to use SSH to run a shell script on a remote machine?

For example - on macOS, there's a command md5 (md5sum on linux) which will accept a path to a file as an argument, and returns a hash. That should help you get started!

danp
  • 14,876
  • 6
  • 42
  • 48