Well, I have a jenkins container running on a Debian VM. We would like to explore the SSH connectivity to the GitRepositories within our container.
Ideally, one would generate keys using ssh-keygen and copy the public key to the git repository.
This step should be sufficient to clone the git repository and I tried it myself on the Debian VM.
However, on the jenkins container, if I do a docker exec -it jenkinscontainerID /bin/bash and perform the same steps, it fails!
I cannot clone the repository. I get the following response :
Cloning into 'TestingRepo'...
git@git.XYZ.de: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Is there any conceptual failure in my understanding that I am missing here?