Help us understand the problem. What is going on with this article?

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

More than 3 years have passed since last update.

概要

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

shao1555
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした