LoginSignup
0
0

Yubikey を用いた ssh key の作成方法

Last updated at Posted at 2024-02-20

準備

PIN を設定

brew install ykman
ykman fido access change-pin

OpenSSH のインストール

mac プリインストールの ssh が対応していないため

brew install openssh

以下を .zshrc などに追加

export PATH=$(brew --prefix openssh)/bin:$PATH

鍵の生成

ssh-keygen -t ed25519-sk -O resident -O verify-required -O application=ssh:main

Option

-O resident

YubiKey に秘密鍵を保存する。別の PC でも秘密鍵を使いたい時に。
別の PC で秘密鍵を取り出したいときは以下。

ssh-keygen -K

-O application={name}

YubiKey 内での名前を指定。指定しないと ssh: になる

-O verify-required

使用時に PIN の入力を必須にする。

-O no-touch-required

使用時に YubiKey のタッチを不要にする。
が、GitHub が対応しておらずこれを指定すると GitHub で鍵が使えなくなるので注意。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0