Jerome
Jerome

Reputation: 6189

Continuously adding SSH key to the ssh-agent

Under OS X 10.9.5, I am constantly hitting the git exit status: 128 error because of Permission denied (public key).

The key is verifiably on the version control system, but every time I change applications I need to:

ssh-add ~/.ssh/id_rsa

to get a deployment process working.

While not very cumbersome, it is a sign of some bad configuration which may be leading to other permissions issues.

Upvotes: 2

Views: 3793

Answers (2)

Remi
Remi

Reputation: 5367

You can also try the following described in the Github docs page Adding your SSH key to the ssh-agent:

If you're using macOS Sierra 10.12.2 or later, you will need to modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.

So either create or edit ~/.ssh/config, and add:

Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/some_id

This way you don't need an additional package.

Upvotes: 2

will_in_wi
will_in_wi

Reputation: 2653

Here is some documentation that has helped me debug SSH-Agent issues in the past: https://developer.github.com/guides/using-ssh-agent-forwarding/

Adding the verbose flag to SSH has helped me fix a number of issues.

Also, try this: https://github.com/capistrano-plugins/capistrano-ssh-doctor

Other than that, I'm not sure I can hazard an answer to this. Good luck!

Upvotes: 0

Related Questions