Skip to content

Feature request: Support host-side .ssh config file and agent authentication #7

Description

@matthijskooijman

We have a number of different of Verdin dev boards available for testing, so I added some aliases for them to my ~/.ssh/config file, also presetting the username:

Host my-verdin
        Hostname verdin-imx8mp-14773670.lan
        User torizon

I also set up key authentication by putting my SSH public key in ~/.ssh/authorized_keys file (using the ssh-copy-id tool), to prevent having to type the password. With that, I can just run:

ssh my-verdin

and get logged in.

So then I tried:

torizoncore-builder deploy --remote-host my-verdin

And was a bit disappointed that that did not work ;-)

That was a while ago - I have since learned that the real torizoncore-builder script runs inside docker and uses paramiko instead of OpenSSH. Both of which seem sensible choices to me, but complicate this feature request a bit.

Still, I would think that supporting SSH configs is convenient, and supporting agent auth is more secure (since passwords on the commandline can be leaked to other users).

To implement this, I think a few things are needed:

  • Using a volume/bindmount to get ~/.ssh/config and /run/user/1000/keyring/ssh (or whatever is in $SSH_AUTH_SOCK) into the container. This needs changes in tcb-env-setup.sh I think.
  • Using paramiko.config.SSHConfig to load ~/.ssh/config and pass the --remote-host value through its lookup() method.
  • Using paramiko.agent.Agent to connect to the agent and handle auth using it (I haven't looked in detail at how that would work).

Is this something you would consider implementing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions