We have a common LDAP account/user. We plan to use this user to configure Jenkins for our team.
- I logged in to the machine/VM using my login and installed Jenkins.
- Then I generated ssh keys from my account only but the email id I provided while generating ssh keys was the common user.
- Then I added the public ssh key to the GitHub (in Github I logged in using common user).
- Added the private key to Jenkins SSH credential plugin.
- Created a job that does poll SCM and it worked fine.
- I need to execute some git commands (i.e pull, checkout, tag etc...). Therefore, I'm writing ant scripts to achieve this.
- When I execute the GIT ant target [1] through Jenkins, I get the following error:
fetch: [echo] ---------------------------------------------------------
[echo] Fetching Latest from git@github.XYZ.com:XYZ/ABC master
[echo] ---------------------------------------------------------
[exec] git@github.XYZ.com: Permission denied (publickey).
[exec] fatal: Could not read from remote repository.
[exec]
[exec] Please make sure you have the correct access rights
[exec] and the repository exists.
Do I have to log in to the VM using common account/user and generate the ssh keys and then use those keys? If yes, then how come Point# 5 is working fine? If no, what is wrong I'm doing here?