librarian v0.2.0 SSH.Config View Source

handles parsing of SSH configuration files.

obtains configuration as follows:

  • check the global config file, set by Application.put_env(:librarian, :global_config_file, <file>), or defaults to /etc/ssh/ssh_config. Alternatively may be set as an option in the load/1 function. You may suppress this by setting either the application environment variable or the option to false. This path must be an absolute path.

  • check the user config file, set by Application.put_env(:librarian, :user_config_file, <file>), or defaults to ~/.ssh/config. Alternatively, may be set as an option in the load/1 function. You may suppress this by setting the application environment variable to false. This path may be a relative path.

warnings

  • Not all of the SSH options can be honored, only the ones that are supported by the erlang :ssh module. Moreover, not all of them have been implemented yet. If you need one, consider submitting a PR or an issue in the issue tracker.
  • If your config file contains an alias for a certain activity, such as SSH tunneling, the config parser will still honor this alias, but will not provide the extra features specified in the config file. This behavior might change in the future or may be accompanied by a warning.
  • wildcard configuration is not supported.
  • argument tokens are not supported.
  • the :user_interaction option defaults to false, which is not the same as the default in erlang.

Due to these warnings, using configuration is defaulted to false in SSH.connect/2. This behaviour may change in the future.

Link to this section Summary

Functions

loads SSH configuration text from global and user configuration files.

parses a configuration text, loaded as a string.

Link to this section Functions

Specs

load(keyword()) :: %{optional(String.t()) => keyword()}

loads SSH configuration text from global and user configuration files.

Defaults to checking /etc/ssh/ssh_config and ~/.ssh/config.

options

  • :global_config_path sets the global config path. Must be absolute. if set to false, will suppress checking global configs.
  • :user_config_path sets the user config path. If set to false, will suppress checking local configs.

Specs

parse(String.t()) :: %{optional(String.t()) => keyword()}

parses a configuration text, loaded as a string.