I added a ssh alias to use a different key-pair for a certain domain. The key does not have a passphrase. I had followed the directions at https://confluence.atlassian.com/bitbucket/configure-multiple-ssh-identities-for-gitbash-mac-osx-linux-271943168.html and at the end added the ssh key with ssh-add.
I later rebooted and the key wasn't working any more - a git fetch from the console in the repo using the alias failed with a permission error. I looked at ssh-add -l and noticed that the key wasn't there anymore. I looked at ssh-add is not persistent between reboots to understand how to fix this - but it seemed from https://unix.stackexchange.com/a/140107/108129 that if I don't have a passphrase, I shouldn't need to.
Is there something I can do to not require to add the key to the ssh-agent - or an easy way to add it permanently?
Update: my .ssh/config is:
VisualHostKey=yes
Host myproject
HostName bitbucket.org
IdentityFile ~/.ssh/myproject
Host *
User yehosef
ssh-agent
is and how does it work and why you can't add it permanently. – Jakuje Dec 14 '16 at 13:22git@bitbucket.com:<user>/<repo>
I usegit@<alias>:<user>/<repo>
when go to the repo and do a (eg)git fetch
, I have a permission issue. If I typessh-add <other IdentityFile>
then thegit fetch
works. I had understood from the link I included that if I don't have a passphrase, which I don't, I shouldn't need ssh-agent. Yet it seems I do. – Yehosef Dec 14 '16 at 14:10.ssh/config
. – Jakuje Dec 14 '16 at 14:23