0
votes

I am trying to run python test cases through Jenkins, it has the git clone command with ssh key.

Command : git clone -v ssh://user@host:29418/project folder_to_clone

Getting the error like :

Warning: Permanently added '[host]:29418,[100.64.42.4]:29418' (RSA) to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

But while running locally everything fine, On Jenkins only getting this issue.

1
Have you added the ssh public key to the user's account profile on Git ServerSunilThorat
If its local Git server, it needs to be added to ~/.ssh/authorized_keys file.SunilThorat
added to ~/.ssh/authorized_keys still facing same issue on Jenkins job.Ankireddy
are you sure you have done it locally from user jenkins? su jenkins; git clonehopetds
My bad, it's working fine, problem is git version mismatch, after updated git version to latest everything working fine.Ankireddy

1 Answers

0
votes

You need to add create a shh key using ssh-key , add it to both jenkins credentials and the git repository you are trying to fetch the code from.