(Lubuntu - 5.11.0-43-generic #47~20.04.2-Ubuntu)
I have played with SSH authentication in the past and failed then too - but didn’t have a use for it… However, that’s changed because I’m looking at using GIT and therefore need to be able to SSH onto my GIT server via cron - so I’m back setting up SSH key authentication.
This is a single computer, which I’m SSHing back to itself for testing and I have done what the internet suggests is the “usual” - being:
(only one of so many examples : Configure SSH for login without a password - PragmaticLinux)
ssh-keygen -f .ssh/id_gitserver
eval "$(ssh-agent -s)"
ssh-add .ssh/id_gitserver
ssh-copy-id -i .ssh/id_gitserver git@gitserver
“OK, nice!”, I think to myself when it all works! However, it seems that I need to rerun the two commands; “eval” and “ssh-add” (which requires the passphase) whenever I logout and back in… I see that I now have a lot of “ssh-agent” processes running, so I’m pretty sure this isn’t how it should work - but does anybody know what I’m doing wrong?
Some posts suggest that I should use “ssh-agent bash” instead of the EVAL command - but I that gives similar/same results.
There is a risk from my testing, that I have nested connections, but I expect the SSH keys to authenticate from my git user regardless of anything.
Thanks.