SSH.id の公開鍵を取得して ~/.ssh/authorized_keys を更新するスクリプト。
# ワンライナーで実行
curl -fsSL https://raw.githubusercontent.com/kurotch-homelab/sshid-sync/main/sshid-sync | bash -s -- --handle <handle>curl -fsSL https://raw.githubusercontent.com/kurotch-homelab/sshid-sync/main/sshid-sync -o /usr/local/bin/sshid-sync
chmod +x /usr/local/bin/sshid-syncsshid-sync # configからハンドルを読み込んで同期
sshid-sync --handle kurotch # ハンドル指定で同期
sshid-sync -n # dry-run(キー表示のみ)
sshid-sync -n --handle kurotch # dry-run + ハンドル指定git config ライクなインターフェースで .sshidconfig を管理。
# 設定
sshid-sync config --global handle kurotch # ~/.sshidconfig に書き込み
sshid-sync config --local handle myhandle # ./.sshidconfig に書き込み
# 取得(local > global の優先順で解決)
sshid-sync config handle
# 一覧
sshid-sync config -l
# 削除
sshid-sync config --unset handle # global から削除
sshid-sync config --local --unset handle # local から削除| 優先度 | ソース |
|---|---|
| 1(最高) | --handle フラグ |
| 2 | ./.sshidconfig(--local) |
| 3 | ~/.sshidconfig(--global、デフォルト) |
| キー | 説明 |
|---|---|
handle |
SSH.id ハンドル |
- SSH.id API (
https://sshid.io/<handle>/ED25519) から公開鍵を取得 ~/.ssh/authorized_keys内のマーカーブロック(# --- sshid-sync managed keys ---)を更新- マーカー外の既存キーは一切変更しない
~/.sshディレクトリやファイルのパーミッションを自動設定(700 / 600)