Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

sshid-sync

SSH.id の公開鍵を取得して ~/.ssh/authorized_keys を更新するスクリプト。

Quick Start

# ワンライナーで実行
curl -fsSL https://raw.githubusercontent.com/kurotch-homelab/sshid-sync/main/sshid-sync | bash -s -- --handle <handle>

Install

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-sync

Usage

同期(デフォルト動作)

sshid-sync                          # configからハンドルを読み込んで同期
sshid-sync --handle kurotch         # ハンドル指定で同期
sshid-sync -n                       # dry-run(キー表示のみ)
sshid-sync -n --handle kurotch      # dry-run + ハンドル指定

config

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 から削除

Config

優先度 ソース
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)

About

SSH.id の公開鍵を取得して authorized_keys を更新するスクリプト

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages