-
-
When true, hosts are added to the
- file without asking the user.
- Defaults to false which will give a user question on stdio of whether to accept or reject a previously
- unseen host.
- If the option value is has an accept_fun(), that fun will called with the arguments
- (PeerName, PeerHostKeyFingerPrint). The fingerprint is calculated on the Peer's Host Key with
- public_key:ssh_hostkey_fingerprint/1.
-
- If the HashAlgoSpec is present and is an crypto:digest_type(), the fingerprint is calculated
- with that digest type by the function
- public_key:ssh_hostkey_fingerprint/2.
+
This option guides the connect function how to act when the connected server presents a Host
+ Key that the client has not seen before. The default is to ask the user with a question on stdio of whether to
+ accept or reject the new Host Key.
+ See also the option user_dir
+ for the path to the file known_hosts where previously accepted Host Keys are recorded.
- If the HashAlgoSpec is present and is a list of crypto:digest_type(), the fingerprint is calulated for
- each digest_type and PeerHostKeyFingerPrint is the list of the results in order corresponding to the
- HashAlgoSpec.
-
+ The option can be given in three different forms as seen above:
+
+ - The value is a boolean(). The value true will make the client accept any unknown
+ Host Key without any user interaction. The value false keeps the default behaviour of asking the
+ the user on stdio.
+
+ - A CallbackFun will be called and the boolean return value true will make the client
+ accept the Host Key. A reurn value of false will make the client to reject the Host Key and therefore
+ also the connection will be closed. The arguments to the fun are:
+
+ - PeerName - a string with the name or address of the remote host.
+ - FingerPrint - the fingerprint of the Host Key as
+ public_key:ssh_hostkey_fingerprint/1
+ calculates it.
+
+
+
+ - A tuple {HashAlgoSpec, CallbackFun}. The HashAlgoSpec specifies which hash algorithm
+ shall be used to calculate the fingerprint used in the call of the CallbackFun. The HashALgoSpec
+ is either an atom or a list of atoms as the first argument in
+ public_key:ssh_hostkey_fingerprint/2.
+ If it is a list of hash algorithm names, the FingerPrint argument in the CallbackFun will be
+ a list of fingerprints in the same order as the corresponding name in the HashAlgoSpec list.
+
+