SSH key will not permanently add to my keychain
One solution is to add the command in ~/.profile
or ~/.bashrc
file. Then every time you open a new terminal the command will be executed automatically.
Since you are using zsh
you will need to add the command to ~/.zprofile
or ~/.zshrc
file.
ssh-add -K ~/.ssh/id_rsa &> /dev/null
The &> /dev/null
is to avoid seeing the Identity added
message everytime you open a new terminal window.
Can try ssh-add -K
again or edit your ~/.ssh/config
to enable the option:
Host *
UseKeychain yes
If ssh-add
states could not connect, try setting it up with:
eval $(ssh-agent)
Similar to: https://superuser.com/a/1158050