LoginSignup
126
98

More than 5 years have passed since last update.

macOS Sierra のSSH接続で、秘密鍵へのパスを覚えてくれない問題

Last updated at Posted at 2016-09-26

macOS Sierra にアップデートされる方はsshに注意です。
どうやらsshする際に指定した秘密鍵へのパスフレーズを覚えてくれない?ようで、しかも仕様みたいです。

"So it looks like Apple changed the behaviour of the ssh-agent in macOS Sierra. Now it does not autoload all the keys in the keychain that were added with ssh-add -K, so you must explicitly call ssh-add -A."
引用元:https://www.reddit.com/r/osx/comments/52zn5r/difficulties_with_sshagent_in_macos_sierra/

とりあえず解決策としては
・configファイルを作って秘密鍵へのパスを指定
・ログイン時に"ssh-add -A"のコマンドを実行するplisetを作成して配置
 参考URL:https://github.com/jirsbek/SSH-keys-in-macOS-Sierra-keychain
のいずれかだそうです。
ちなみに、後者で接続できることを確認しています。

前者はターミナルで接続を試みる分には色々と便利なのですが、SourceTreeとかでSSHする場合には不便なので後者が良いのでは?と思います。
※コメントで"ppengotsu"さんより指摘があり、どうやらSourceTreeでもちゃんとsshのconfigを見ているようです。前者を試されることをお勧めします。

先週この問題にぶち当たった際には全然情報がなかったのですが、今週に入ってにわかに情報が出てきました。今の所日本語で解説しているところがないので調べる際は英語サイトを見てみたら色々と分かるかと思います。

追記
一応念のため、今回 macOS Sierra はクリーンインストールしているので、El Capitan からアップデートされた場合にどうなるのかは把握していません。あしからず。

126
98
6

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
126
98