macOS ssh Keys Get Removed Randomly











up vote
0
down vote

favorite












Using ssh-keygen, I generated an ssh key. I did not use a passphrase. I added the identity with ssh-add so I didn't have to enter credentials every time I used the key. I have regularly used these ssh keys over the past few months.



Every few weeks, I'm prompted for credentials when I use ssh, and have to re-add the ssh key in order to avoid that.



Does anyone have any suggestions?










share|improve this question
























  • Does this coincide with you logging out and logging in again?
    – Kusalananda
    Nov 16 at 11:34










  • Sometimes yes, sometimes no. It's not consistent. What would a solution be if it did coincide with that?
    – leftAsAnExerciseToTheReader
    Nov 20 at 11:35










  • If ssh is not using your key after you have freshly logged in, it could be that your ssh-agent was not yet given the key. Run ssh-add in that case.
    – Kusalananda
    Nov 20 at 11:59










  • The issue is that I have to run ssh-add for the same key at different points in time. It was my understanding that ssh-add would add the key permanently. It's almost like ssh-add "forgets" the key was added.
    – leftAsAnExerciseToTheReader
    2 days ago










  • Are you starting an SSH agent explicitly on the command line at any point? I think macOS starts one by default.
    – Kusalananda
    2 days ago















up vote
0
down vote

favorite












Using ssh-keygen, I generated an ssh key. I did not use a passphrase. I added the identity with ssh-add so I didn't have to enter credentials every time I used the key. I have regularly used these ssh keys over the past few months.



Every few weeks, I'm prompted for credentials when I use ssh, and have to re-add the ssh key in order to avoid that.



Does anyone have any suggestions?










share|improve this question
























  • Does this coincide with you logging out and logging in again?
    – Kusalananda
    Nov 16 at 11:34










  • Sometimes yes, sometimes no. It's not consistent. What would a solution be if it did coincide with that?
    – leftAsAnExerciseToTheReader
    Nov 20 at 11:35










  • If ssh is not using your key after you have freshly logged in, it could be that your ssh-agent was not yet given the key. Run ssh-add in that case.
    – Kusalananda
    Nov 20 at 11:59










  • The issue is that I have to run ssh-add for the same key at different points in time. It was my understanding that ssh-add would add the key permanently. It's almost like ssh-add "forgets" the key was added.
    – leftAsAnExerciseToTheReader
    2 days ago










  • Are you starting an SSH agent explicitly on the command line at any point? I think macOS starts one by default.
    – Kusalananda
    2 days ago













up vote
0
down vote

favorite









up vote
0
down vote

favorite











Using ssh-keygen, I generated an ssh key. I did not use a passphrase. I added the identity with ssh-add so I didn't have to enter credentials every time I used the key. I have regularly used these ssh keys over the past few months.



Every few weeks, I'm prompted for credentials when I use ssh, and have to re-add the ssh key in order to avoid that.



Does anyone have any suggestions?










share|improve this question















Using ssh-keygen, I generated an ssh key. I did not use a passphrase. I added the identity with ssh-add so I didn't have to enter credentials every time I used the key. I have regularly used these ssh keys over the past few months.



Every few weeks, I'm prompted for credentials when I use ssh, and have to re-add the ssh key in order to avoid that.



Does anyone have any suggestions?







ssh osx macintosh






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago

























asked Nov 16 at 9:02









leftAsAnExerciseToTheReader

13




13












  • Does this coincide with you logging out and logging in again?
    – Kusalananda
    Nov 16 at 11:34










  • Sometimes yes, sometimes no. It's not consistent. What would a solution be if it did coincide with that?
    – leftAsAnExerciseToTheReader
    Nov 20 at 11:35










  • If ssh is not using your key after you have freshly logged in, it could be that your ssh-agent was not yet given the key. Run ssh-add in that case.
    – Kusalananda
    Nov 20 at 11:59










  • The issue is that I have to run ssh-add for the same key at different points in time. It was my understanding that ssh-add would add the key permanently. It's almost like ssh-add "forgets" the key was added.
    – leftAsAnExerciseToTheReader
    2 days ago










  • Are you starting an SSH agent explicitly on the command line at any point? I think macOS starts one by default.
    – Kusalananda
    2 days ago


















  • Does this coincide with you logging out and logging in again?
    – Kusalananda
    Nov 16 at 11:34










  • Sometimes yes, sometimes no. It's not consistent. What would a solution be if it did coincide with that?
    – leftAsAnExerciseToTheReader
    Nov 20 at 11:35










  • If ssh is not using your key after you have freshly logged in, it could be that your ssh-agent was not yet given the key. Run ssh-add in that case.
    – Kusalananda
    Nov 20 at 11:59










  • The issue is that I have to run ssh-add for the same key at different points in time. It was my understanding that ssh-add would add the key permanently. It's almost like ssh-add "forgets" the key was added.
    – leftAsAnExerciseToTheReader
    2 days ago










  • Are you starting an SSH agent explicitly on the command line at any point? I think macOS starts one by default.
    – Kusalananda
    2 days ago
















Does this coincide with you logging out and logging in again?
– Kusalananda
Nov 16 at 11:34




Does this coincide with you logging out and logging in again?
– Kusalananda
Nov 16 at 11:34












Sometimes yes, sometimes no. It's not consistent. What would a solution be if it did coincide with that?
– leftAsAnExerciseToTheReader
Nov 20 at 11:35




Sometimes yes, sometimes no. It's not consistent. What would a solution be if it did coincide with that?
– leftAsAnExerciseToTheReader
Nov 20 at 11:35












If ssh is not using your key after you have freshly logged in, it could be that your ssh-agent was not yet given the key. Run ssh-add in that case.
– Kusalananda
Nov 20 at 11:59




If ssh is not using your key after you have freshly logged in, it could be that your ssh-agent was not yet given the key. Run ssh-add in that case.
– Kusalananda
Nov 20 at 11:59












The issue is that I have to run ssh-add for the same key at different points in time. It was my understanding that ssh-add would add the key permanently. It's almost like ssh-add "forgets" the key was added.
– leftAsAnExerciseToTheReader
2 days ago




The issue is that I have to run ssh-add for the same key at different points in time. It was my understanding that ssh-add would add the key permanently. It's almost like ssh-add "forgets" the key was added.
– leftAsAnExerciseToTheReader
2 days ago












Are you starting an SSH agent explicitly on the command line at any point? I think macOS starts one by default.
– Kusalananda
2 days ago




Are you starting an SSH agent explicitly on the command line at any point? I think macOS starts one by default.
– Kusalananda
2 days ago















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482100%2fmacos-ssh-keys-get-removed-randomly%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f482100%2fmacos-ssh-keys-get-removed-randomly%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

サソリ

広島県道265号伴広島線

Accessing regular linux commands in Huawei's Dopra Linux