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
Closes #18859
This commit is contained in:
Daniel Stenberg 2025-10-05 23:19:13 +02:00
parent 762ce8801b
commit aae18c4bdc
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
11 changed files with 48 additions and 14 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:
- --knownhost filename --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 known hosts file. curl uses the ~/.ssh/known_hosts in the user's
home directory by default.
This option lets a user specify a specific file to check the host against.
The known hosts check can be disabled with --insecure, but that makes the
transfer insecure and is strongly discouraged.

View file

@ -111,6 +111,7 @@
--keepalive-time 7.18.0
--key 7.9.3
--key-type 7.9.3
--knownhosts 8.17.0
--krb 7.3
--libcurl 7.16.1
--limit-rate 7.10