Score:1

Git can't access SSH key after every laptop restart

pt flag

So I have set up SSH key on my Ubuntu 20.04 with this guide. The problem is that every time I restart my machine and try to use the SSH key with git pull or some command that requires SSH auth it says permission denied.

To fix that temporarely I just run these two commands:

eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519

What is the permanent fix for this so I don't have to run these two commands every time I want to use the SSH key for Git?

Score:0
cn flag

It will not completely fix it, but adding those lines to your ~/.bashrc or ~/.zshrc or which shell rc you are using. Will fix it without you having to do it, it is not proper fix but it should work as a workaround.

crodev avatar
pt flag
Sure I'll try it. I'll see if it works next time I restart and I'll give feedback here. Thanks!
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.