Documentation
¶
Overview ¶
Package ssh provides SSH authentication helpers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthMethods ¶
AuthMethods builds the list of SSH auth methods for a host config. The returned io.Closer must be closed when the SSH connection is done to release any resources (e.g. the SSH agent socket). It may be nil.
ctx bounds the work against the SSH agent, which happens during the handshake that follows.
func HostKeyCallback ¶
HostKeyCallback returns a callback that verifies remote host keys against ~/.ssh/known_hosts (TOFU — Trust On First Use):
- Known host, key matches → allowed
- Unknown host → key is added to known_hosts, allowed
- Known host, key changed → rejected with a clear error message
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.