tool_getparam: add --knownhosts

To allow users to specify a known hosts file that is not the default
one: ~/.ssh/known_hosts

URL: https://github.com/curl/curl/discussions/18784
This commit is contained in:
Daniel Stenberg 2025-10-05 23:19:13 +02:00
parent b54b4697ca
commit eb9422dc0e
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
9 changed files with 45 additions and 6 deletions

View file

@ -147,6 +147,7 @@ DPAGES = \
keepalive-time.md \
key-type.md \
key.md \
knownhosts.md \
krb.md \
libcurl.md \
limit-rate.md \

View file

@ -0,0 +1,31 @@
---
c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
SPDX-License-Identifier: curl
Long: knownhosts
Arg: <file>
Protocols: SCP SFTP
Help: Specify knownhosts path
Category: ssh
Added: 8.17.0
Multi: single
See-also:
- hostpubsha256
- hostpubmd5
- insecure
- key
Example:
- --cert certificate --key here $URL
---
# `--knownhosts`
When doing SCP and SFTP transfers, curl automatically checks a database
containing identification for all hosts it has ever been used with to verify
that the host it connects to is the same as previously. Host keys are stored
in such a knownhosts file. By default curl uses ~/.ssh/known_hosts in the
user's home directory.
This option lets a user specify a specific file to check the host against.
The known host check can be disabled with --insecure, but that makes the
transfer insecure.