Skip to content

cmd/tailcat: ssh has no way to choose an SSH identity file #174

Open

Description

@semmi88

cmd/tailcat: ssh has no way to choose an SSH identity file

Use case

I want to connect with tailcat ssh to different servers, each started with different authorized key (tailcat serve --ssh-authorized-keys=... ssh). I would like to be able to choose the key per invocation from the command line

Current behavior

Currently there is no way to pass identity file through

  • tailcat ssh -i ~/.ssh/mykey <tc-addr> fails, because -i is not a known flag.
  • tailcat ssh <tc-addr> -i ~/.ssh/mykey passes -i ~/.ssh/mykey after --, so ssh runs it as the remote command.

Workarounds

  • ssh-agent, holding all key, offers keys one at a time until one succeeds - user cannot specify which key to use
  • ~/.ssh/config entries per server specifying IdentityFile - needs to be kept up to date

Proposal

tailcat ssh gets new -i flag

  • keyfile is passed to ssh as -i <file> -o IdentitiesOnly=yes
  • it would follow the existing -p flag, and come before --
    tailcat cp could also be updated -i flag for consistency

I'm happy to send a PR for this, if you agree with this approach
The estimated since the size of this change would be small (~30 lines of code + tests).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions