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

オープン 初心者向け
#174 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
go
領域
cli

調査の方向性

まず tailcat ssh のフラグ処理と、ssh に渡す引数の組み立て方を読みます。この issue では特定のファイルやテストは指定されていません。提案されている -i オプションを -- の前に追加し、identity file と -o IdentitiesOnly=yes を渡してから、引数処理のテストを追加または更新します。tailcat ssh -i <file> <address> でその identity が選択され、リモートコマンドの引数も引き続き機能すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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).

主要言語
Go
スター
10.1k
フォーク
470
平均マージ
1日 14時間
マージ済み PR(30日)
19

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

tailscale/tailcat のほかの issue

tailscale/tailcat の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。