LoginSignup
30
26

More than 5 years have passed since last update.

macOS 10.12 Sierra で SSH のパスフレーズを憶えてくれない問題への workaround

Posted at

概要

macOS 10.12 (Sierra) で、キーチェーンが SSH のパスフレーズを憶えてくれず、毎回入力しなくてはいけなくて煩雑。

shao-01:~/dev/ % git clone git@github.com/some-organization/some-repository.git
Enter passphrase for key '/Users/shao/.ssh/id_rsa':

ああ、イライラ。

対処法

~/.ssh/config (なければ作る) に以下の記述をする。

~/.ssh/config
Host *
   UseKeychain yes
   AddKeysToAgent yes

便利。

おまけ

「都度入れたくはないが、定期的に確認はしたい」というむきには、キーチェーンアクセスの「キーチェーン設定」がおすすめ。

"キーチェーンアクセス.app" を開き、編集→ キーチェーン"ログイン" の設定を変更…

image

無操作時やスリープ時にキーチェーンをロックしておけば、SSH の公開鍵もロック中はパスフレーズを聞かれるようになる。

参考文献

difficulties with ssh-agent in macOS Sierra : osx - Reddit

30
26
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
30
26