I have installed git in the Linux server(Server1) and created a remote git repository in that server1 Now I need to clone the git repository to server2 through Jenkins so I installed Jenkins in the server2, Now Jenkins was hosted in server2.
In Jenkins I have created a freestyle project, In the Repository URL section, I entered the URL of git repo like: git@<server1_ip>:/opt/dev/repo/pals/ui.git
For authentication, I have tried each credential one by one given below:
git repo username and password git repo username and SSH Private key Jenkins username and password Jenkins username and SSH Private key But I am facing the below error:
Repository URL
git@<server1_ip>:/opt/dev/repo/pals/ui.git
Failed to connect to repository : Command "git ls-remote -h -- git@<server1_ip>:/opt/dev/repo/pals/ui.git HEAD" returned status code 128: stdout: stderr: Permission denied, please try again. Permission denied, please try again. git@<server1_ip>: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.