Hi Mark,

yes. I think the problem is not by the plugin :-)

I recreated a new public key and tried again the git plugin. This works 
now. It updates a git clone in the Jenkins workspace, as expected.

But back to my initial plan. I want to trigger an git update, chekout, ... 
on a remote server. This should also be possible?

Here I get the same error.

Without Jenkins (only cli) I would for example login with ssh -A to 
activate the ssh agent forwarding and I'll able lo connect to the git 
repository (permissions provided).

How would you solve that scenario?

Thanks,
Daniel

Am Mittwoch, 11. Mai 2016 07:18:04 UTC+2 schrieb Daniel Koch:
>
> Hi,
>
> I want to setup a simple Jenkins job for managing (f.e. updating) my 
> existing remote git repository (Bitbucket server) with the following 
> criterias:
>
>    - Authentication on the remote using ssh key authentication
>    - Git authentication using configured access key
>
> I installed the following plugins:
> Setup SSH Agent Plugin (ssh-agent 
> <https://wiki.jenkins-ci.org/display/JENKINS/SSH+Agent+Plugin>)
> SSH plugin (ssh 
> <https://wiki.jenkins-ci.org/display/JENKINS/SSH+Agent+Plugin>)
>
> What I did so far:
>
>    1. Configure ssh key identity to login to the remote maschine (private 
>    key, password)
>    2. Configure a SSH host for the remote under "Manage Jenkins"
>    3. Configure a Jenkins job with "Build Environment": Selecting the 
>    configured ssk key (1.) under "SSH Agent"
>    4. Under "Build" I add a "Execute shell script on remote host using 
>    ssh". Here I add for example git fetch
>    5. I also add the public key on the remote under authorized_keys
>    6. On Bitbucker server I add the ssh public key as an "Access key"
>
> What happens if I "run" the job:
> Started by user <Jenkins username>
> Building in workspace <path>/workspace/<Jenkins job>
> [ssh-agent] Looking for ssh-agent implementation...
> [ssh-agent] Java/JNR ssh-agent
> [ssh-agent] Started.
> [ssh-agent] Using credentials <ssh key user from 1.>
> executing script:
>
> git fetch
> Permission denied (publickey).
> fatal: The remote end hung up unexpectedly
> [SSH] exit-status: 128
> Build step 'Execute shell script on remote host using ssh' marked build as 
> failure
> [ssh-agent] Stopped.
> Finished: FAILURE
>
> I think the problem is the proper authentication against the git 
> repository. I would expect here that the job is using the identity of the 
> configured ssh key identity?!
>
> Thanks,
> Daniel
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7d9dc97f-14e2-418b-9b95-f6607f110773%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to