Every time I restart, I need to execute ssh-add
, or git fetch
will fail and give me a "permission denied" message. How do I solve it?
Asked
Active
Viewed 52 times
1
-
1Lots of questions to ask here: first, what are you connecting to - a private repository in a company, or GitHub/Bitbucket/GitLab? Do you have more than one key defined on your system that could cause the confusion? – Makoto Mar 07 '17 at 03:44
-
it is a private repository in company,and i do not have more than on key. – husker Mar 08 '17 at 01:58
1 Answers
1
On mac, you can use ssh-add -K ~/.ssh/your_private_key
If not, you need to add that step in ~/.profile
.
You have other alternatives detailed in "Add private key permanently with ssh-add on Ubuntu" which might apply to MacOS as well.