sshagent with problems to copy files to remote server

815 views
Skip to first unread message

Mario Rodriguez

unread,
Oct 14, 2016, 5:52:15 PM10/14/16
to Jenkins Users
Hi, I'm trying to use sshagent plugin to copy some generated artifacts from the jenkins server to a remote server, however, I'm missing something on the setup and the build is failing with this "unkown user" error highlighted below

here is the code snippet from my Jenkinsfile

stage 'Deployment to batch server'
sh "chmod a+x ${workspace}/build/resources/main/deltajob.sh"

sshagent(credentials: ['deploy-batchjob']) {
sh "scp -o StrictHostKeyChecking=no ${workspace}/build/libs/*-all.jar deploy@batch01:/batch/producer-job/"
}

"deploy" user is a local account at batch01 remote server.


[Pipeline] stage (Deployment to batch server)
[Pipeline] sh
[develop] Running shell script
+ chmod a+x /var/jenkins_home/workspace/MyCompany/producer-batch-job/develop/build/resources/main/deltajob.sh
[Pipeline] sshagent
[ssh-agent] Using credentials deploy (credential to deploy batch jobs)
[ssh-agent] Looking for ssh-agent implementation...
[ssh-agent]   Java/JNR ssh-agent
[ssh-agent] Skipped registering BouncyCastle, not running on a remote agent
[ssh-agent] Started.
[Pipeline] {
[Pipeline] sh
[develop] Running shell script
+ scp -o StrictHostKeyChecking=no /var/jenkins_home/workspace/MyCompany/producer-batch-job/develop/build/libs/deltajob-all.jar  deploy@batch01:/batch/producer-job/
unknown user 1000060000
[Pipeline] }
[Pipeline] // sshagent


any ideas ?

Victor Martinez

unread,
Oct 14, 2016, 6:25:03 PM10/14/16
to Jenkins Users
did you try to debug that scp command locally with some -v flags?
Reply all
Reply to author
Forward
0 new messages