### Configure Shoehorn Initialization Source: https://github.com/nerves-project/nerves_ssh/blob/main/README.md Include :nerves_ssh in the :init list for :shoehorn to ensure it starts automatically. This is a common setup for Nerves projects not using :nerves_pack v0.4.0 or later. ```elixir config :shoehorn, init: [:nerves_runtime, :vintage_net, :nerves_ssh] ``` -------------------------------- ### Start NervesSSH in Supervision Tree Source: https://github.com/nerves-project/nerves_ssh/blob/main/README.md Integrate NervesSSH into your application's supervision tree by adding NervesSSH as a child. Ensure that :nerves_ssh is NOT configured in config.exs if you choose this method. ```elixir {NervesSSH, nerves_ssh_options} ``` -------------------------------- ### Configure Username/Password Authentication Source: https://github.com/nerves-project/nerves_ssh/blob/main/README.md Set up username and password authentication for SSH access. Note that passwords are stored in the clear and this is not recommended for most situations. ```elixir config :nerves_ssh, user_passwords: [ {"username", "password"} ] ``` -------------------------------- ### Upgrade NervesSSH Configuration Source: https://github.com/nerves-project/nerves_ssh/blob/main/README.md This shell command demonstrates how to replace old NervesFirmwareSSH configuration values with NervesSSH values in your project files. ```sh grep -RIl nerves_firmware_ssh config/ | xargs sed -i 's/nerves_firmware_ssh/nerves_ssh/g' ``` -------------------------------- ### Configure SSH Host Key Checking Source: https://github.com/nerves-project/nerves_ssh/blob/main/README.md Add this configuration to your ~/.ssh/config to avoid SSH client errors when rewriting MicroSD cards frequently. ```sshconfig Host nerves.local UserKnownHostsFile /dev/null StrictHostKeyChecking no ``` -------------------------------- ### Configure Public Key Authentication Source: https://github.com/nerves-project/nerves_ssh/blob/main/README.md Specify authorized public SSH keys in your application configuration. This allows clients with matching keys to connect. ```elixir config :nerves_ssh, authorized_keys: [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDBCdMwNo0xOE86il0DB2Tq4RCv07XvnV7W1uQBlOOE0ZZVjxmTIOiu8XcSLy0mHj11qX5pQH3Th6Jmyqdj", "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCaf37TM8GfNKcoDjoewa6021zln4GvmOiXqW6SRpF61uNWZXurPte1u8frrJX1P/hGxCL7YN3cV6eZqRiF" ] ``` ```elixir config :nerves_ssh, authorized_keys: [ File.read!(Path.join(System.user_home!, ".ssh/id_rsa.pub")) ] ``` -------------------------------- ### Add NervesSSH Dependency Source: https://github.com/nerves-project/nerves_ssh/blob/main/README.md Add the nerves_ssh library to your project's dependencies. This is typically done when not using :nerves_pack v0.4.0 or later. ```elixir def deps do [ {:nerves_ssh, "~> 0.1.0", targets: @all_targets} ] end ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.