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

[Sierra] macos Sierra に更新してから、毎回パスフレーズを聞かれてくることに対する対策 [ssh]

More than 3 years have passed since last update.

~/.ssh/config へ、次のを突っ込んでおくことが望ましいようです。

.ssh/config
Host *
   AddKeysToAgent yes
   UseKeychain yes

AddKeysToAgent

man ssh_config から

Specifies whether keys should be automatically added to a running ssh-agent(1). If this option is set to 'yes' and a key is loaded from a file, the key and its passphrase are added to the agent with the default lifetime, as if by ssh-add(1). If this option is set to `ask', ssh will require confirmation using the SSH_ASKPASS program before adding a key (see ssh-add(1) for details). If this option is set to 'confirm', each use of the key must be confirmed, as if the -c option was specified to ssh-add(1). If this option is set to 'no', no keys are added to the agent. The argument must be 'yes', 'confirm', 'ask', or 'no'. The default is 'no'.

AddKeysToAgent オプションを 'yes' にすると、ssh-add 同様 ssh-agent へ、パスフレーズが登録されると、man には記述ありますが、mac osの場合、ssh-agent を使ってなく、KeyChain を使っていますので、KeyChain へ登録されます。

確認できていないのですが、Sierra の versionによっては、これが効かない場合があるようなので、最新へアップデートしてみてください。

にっちもさっちもいかない場合は、ssh-add -K <idファイル> で登録できます(´・ω・`)

UseKeychain

man ssh_config から

On macOS, specifies whether the system should search for passphrases in the user's keychain when attempting to use a particular key. When the passphrase is provided by the user, this option also specifies whether the passphrase should be stored into the keychain once it has been verified to be correct. The argument must be 'yes' or 'no'. The default is 'no'.

macOSの時だけ有効です。これを 'yes' にしておくと、mac の Keychain を見に行って、パスフレーズが登録されていれば、そちらを利用してくれます。

sho7650
妻x1+娘x4 オンプレインフラメインのインフラエンジニアが、ソフトウェア中心のPaaS/SaaS業界へ転身し、一度はやめたアプリケーションに手を出し始めている昨今、みなさまいかがお過ごしでしょうか。 外資系はいいぞ(
http://oshiire.to
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
ユーザーは見つかりませんでした