ssh_agent

ssh_agent

ssh_agent
Callback module for using an SSH agent instead of the default ssh_file callback.
Module ssh_agent was introduced in OTP 23.0.

This module defines a callback handler for the communication with an SSH Agent and can be used to replace the default callback. This allows to issue signing requests to an agent that stores SSH private keys to perform authentication.

Ssh_agent implements the ssh_client_key_api, to allow it to be used by setting the option key_cb when starting a client (with for example ssh:connect, ssh:shell ).

      {key_cb, {ssh_agent, []}}

The agent communication is established through a UNIX domain socket. By default, the socket path will be fetched from the SSH_AUTH_SOCK enviroment variable, which is the default socket path in the agent implementation of OpenSSH.

In order to set a different socket path the socket_path option can be set.

      {key_cb, {ssh_agent, [{socket_path, SocketPath}]}}
Note

The functions are Callbacks for the SSH app. They are not intended to be called from the user's code!

Sets the time-out in milliseconds when communicating with the agent via the socket. The default value is 1000.

Types

Result = ok | {error, Error :: term()}

This callback is delegated to the ssh_file module.

This callback is delegated to the ssh_file module.