3

While connecting to a SFTP server on Windows using WinSCP, I need to pass hostkey fingerprint through the -hostkey switch.

Is a similar option available in sftp command in Linux?

2 Answers2

2

you should definitely read the man page :

https://www.freebsd.org/cgi/man.cgi?query=sftp&sektion=1

I think the -o option is what you need, this will allow you to send options to the sublayer SSH agent in the sftp transaction.

vdegenne
  • 1,746
  • How does this answer the question? Reading manual is a good hint, but there is no way to specify hostkey fingerprint in sftp from OpenSSH. – Jakuje Jan 27 '17 at 09:50
  • @Jakuje an answer may not always solve the question, that is why there is the validate the answer feature. I am not really an sftp expert, in fact i never used it but based on my experience I always find a solution reading the manuals. That is why I told him/her to read it in case he didn't know that feature in Linux OSes. You know just trying to help people out is a good thing. – vdegenne Jan 27 '17 at 14:32
  • Not saying that helping is wrong, but generic answers as RTFM are rather suitable for the comments, especially with "i think" phrases. – Jakuje Jan 27 '17 at 14:58
0

No. In SFTP there is no way to pass the fingerprint. Once the server will present you the fingerprint, you are asked to verify that.

There is no way to pass the fingerprint in this way, not even using -o option, but you can manually store the whole public key to the ~/.ssh/known_hosts.

Jakuje
  • 21,357