View Source NervesSSH.Options (nerves_ssh v1.0.0)
Defines option for running the SSH daemon.
The following fields are available:
:name
- a name used to reference the NervesSSH-managed SSH daemon. Defaults toNervesSSH
.:authorized_keys
- a list of SSH authorized key file string:port
- the TCP port to use for the SSH daemon. Defaults to22
.:subsystems
- a list of SSH subsystems specs to start. Defaults to SFTP andssh_subsystem_fwup
:user_dir
- where to find authorized_keys file:system_dir
- where to find host keys:shell
- the language of the shell (:elixir
,:erlang
,:lfe
or:disabled
). Defaults to:elixir
.:exec
- the language to use for commands sent over ssh (:elixir
,:erlang
, or:disabled
). Defaults to:elixir
.:iex_opts
- additional options to use when starting up IEx:user_passwords
- a list of username/password tuples (stored in the clear!):daemon_option_overrides
- additional options to pass to:ssh.daemon/2
. These take precedence and are unchecked. Be careful using this since it can break other options.
Summary
Functions
Add an authorized key
Add user credential to SSH options
Return :ssh.daemon_options()
Decode the authorized keys into Erlang public key format
Load authorized keys from the authorized_keys file
Convert keyword options to the NervesSSH.Options
Remove an authorized key
Remove user credential from SSH options
Go through the options and fix anything that might crash
Save the authorized keys to authorized_keys file
Create a new NervesSSH.Options and fill in defaults
Types
@type language() :: :elixir | :erlang | :lfe | :disabled
@type t() :: %NervesSSH.Options{ authorized_keys: [String.t()], daemon_option_overrides: keyword(), decoded_authorized_keys: [:public_key.public_key()], exec: language(), iex_opts: keyword(), name: GenServer.name(), port: non_neg_integer(), shell: language(), subsystems: [:ssh.subsystem_spec()], system_dir: Path.t(), user_dir: Path.t(), user_passwords: [{String.t(), String.t()}] }
Functions
Add an authorized key
Add user credential to SSH options
@spec daemon_options(t()) :: :ssh.daemon_options()
Return :ssh.daemon_options()
Decode the authorized keys into Erlang public key format
Load authorized keys from the authorized_keys file
Convert keyword options to the NervesSSH.Options
Remove an authorized key
Remove user credential from SSH options
Go through the options and fix anything that might crash
The goal is to make options "always work" since it is painful to debug typo's, etc. that cause the ssh daemon to not start.
@spec save_authorized_keys(t()) :: :ok | {:error, File.posix()}
Save the authorized keys to authorized_keys file
Create a new NervesSSH.Options and fill in defaults