189
132

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GitのSSH鍵認証で毎回パスワードを要求される

Last updated at Posted at 2018-10-12

環境情報

  • Mac High Sierra

問題

git pullなどで毎回パスワードを要求されてしまう。

$ git pull
Enter passphrase for key '/Users/user_name/.ssh/id_rsa':

解決方法

鍵の場所などは適宜読み替えてください。:pray:

// SSH鍵をssh-agentに登録
$ ssh-add /Users/user_name/.ssh/id_rsa

// 上記パス(~/.ssh/id_rsa)の場合、下記でも登録可能
$ ssh-add -K

// 登録されていることを確認する
$ ssh-add -l

追記(2025/07/03)

-Kオプションがdeprecatedになっているようです。現在は下記で対応しています

ssh-add --apple-use-keychain ~/.ssh/id_rsa
189
132
3

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
189
132

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?