I am running a Bitnami Jenkins Stack Cloud on Azure.
Issue: Unable to ssh clone from Gitlab account.
Steps:
1) Create a pipeline job
2) Select Source Code Management -> Git
3) Add gitlab ssh clone url
4) Add credentials -> SSH with username (username: git, passphrase: xxx)
In bitnami jenkins stack, the jenkins instance run on a user called tomcat. So, I added ssh-key pair for that user, and added the public key to my Gitlab account.
When I follow the above steps while configuring pipeline job, I receive an error:
Failed to connect to repository : Command "/opt/bitnami/git/bin/git ls-remote -h g...@gitlab.com:baymac/building-a-multibranch-pipeline-project.git HEAD" returned status code 128:stdout: stderr: ssh: /opt/bitnami/common/lib/libcrypto.so.1.0.0: no version information available (required by ssh)ssh: /opt/bitnami/common/lib/libcrypto.so.1.0.0: no version information available (required by ssh)Permission denied (publickey). fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.
To verify if it is working, according to the Bitnami
docs, I ran the same command the pipeline job runs:
tomcat@bitnami-jenkins-2c92$ /opt/bitnami/git/bin/git ls-remote -h g...@gitlab.com:baymac/building-a-multibranch-pipeline-project.git HEAD
/usr/bin/ssh: /opt/bitnami/common/lib/libcrypto.so.1.0.0: no version information available (required by /usr/bin/ssh)
/usr/bin/ssh: /opt/bitnami/common/lib/libcrypto.so.1.0.0: no version information available (required by /usr/bin/ssh)
Enter passphrase for key '/home/tomcat/.ssh/id_rsa':
The ssh connection is validated! The same command is executed by the job but it returns a status code 128. I elevated the permissions of the Jenkins user to max but nothing changed.
Possible problems could be in providing the wrong details of credentials but I cannot figure it out, I have tried numerous other combinations by giving the private key directly also but it doesn't work. Some help would be highly appreciaated.