2

Since SFTP stands for SSH + FTP, I assume I always should create a SSH key pair for it, however, I see in my client configuration that that is optional.

That is applicable for both server-side and client-side SSH key pair.

Jamo
  • 143
  • 5

1 Answers1

4

A host key is mandatory for any ssh server. The server can have multiple host keys using different algorithms. If no key is present when the server is started a host key is generated for the server.

An ssh client can authenticate with a wide range of different methods. The two most common are password and publickey. As the name suggests only publickey requires a key. It is very often recommended to use publickey as it has multiple security benefits compared to password, and publickey is also better for the user experience.

The above applies both when using ssh to run commands on the remote machine as well as when using scp or sftp to transfer files. Once your keys have been created the same key files will be used for all three commands.

kasperd
  • 5,402
  • 1
  • 19
  • 38