I have two ssh keys on my computer. Both have a password. Unfortunately, even though I set up a config file, I get asked for the password every single time I do anything with it.
β .ssh ls -lh
total 28K
-rw-r--r-- 1 lukas lukas 253 29. Mai 11:11 config
-rw------- 1 lukas lukas 3,4K 29. Mai 10:52 id_rsa_github_privat
-rw-r--r-- 1 lukas lukas 743 29. Mai 10:52 id_rsa_github_privat.pub
-rw------- 1 lukas lukas 3,4K 29. Mai 10:52 id_rsa_github_work
-rw-r--r-- 1 lukas lukas 751 29. Mai 10:52 id_rsa_github_work.pub
-rw------- 1 lukas lukas 828 29. Mai 11:04 known_hosts
-rw-r--r-- 1 lukas lukas 92 29. Mai 11:04 known_hosts.old
# Personal account
Host privat
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_github_privat
AddKeysToAgent yes
# Work account
Host work
HostName github.com
User git
IdentityFile ~/.ssh/id_rsa_github_work
AddKeysToAgent yes
I get asked for the password every time, which seems to be a problem with the ssh agent. If I run this:
β ~ ssh-add -l
Could not open a connection to your authentication agent.
I get this message and I have to restart it:
β ~ eval "$(ssh-agent -s)"
Agent pid 206575
β ~ ssh-add -l
The agent has no identities.
Then of course I have to add the keys again.
It forgets everything every time I open a new terminal window.
I can add all of this junk to my zshrc, but then I would need to type in two passwords very time I open a terminal
Does anybody have a solution for this?
I have seen a couple of similar topics here and on stack overflow, but nothing worked here.
Maybe this is a bug with the gnome keychain? I dont know