Jenkins does not have permissions to change from the repository. The public key of my current user on the server cat ~/.ssh/id_rsa.pub added to the Deploy keys repository. Machine Win 2012 R2, Jenkins 2.6.

Added Credentials in two ways.

The first one used the Username with password setting and added the username / pass of the user with known sufficient rights.

 stderr: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists 

The second one - used the SSH Username with private key setting SSH Username with private key + From the Jenkins master ~/.ssh , where I copied ~/.ssh

  stderr: Load key "C:\\Windows\\TEMP\\ssh5189845575748942561.key": invalid format Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 

Where do I make a mistake? And how do I deal with the data for connecting jenkins to the gitlab?

  • Check that the repository is generally pinged from jenkins. - Nick Volynkin
  • Load key "...": invalid format hints that the key is invalid. You gave him exactly the right id_rsa ? - Nick Volynkin
  • The simplest thing is to open a repository for public access, and in Jenkins, it can be cloned over https. Then authorization is not needed at all. - Nick Volynkin
  • The @NickVolynkin repository is private, you can’t change it here. The key is valid for my user, with him I can perform any actions with the repository. I saw the root directory in the jenkins settings and copied my .ssh / there. Perhaps you are right and jenkins does not understand this key format. Then I do not understand what keys he generally uses. - while1pass
  • @NickVolynkin did not understand the message the репозиторий вообще пингуется с дженкинса . Through the web interface somehow or through the console with a user change to jenkins (is the repository available through my current user)? Unfortunately, I don’t see such user in Win - while1pass

0