Я пытаюсь подключиться к удаленному компьютеру через s sh и пытаюсь выполнить на нем несколько сценариев. Ниже мой код.
def remote = [:]
remote.name = "ssh server"
remote.host = "****"
remote.allowAnyHosts = true
node {
withCredentials([sshUserPrivateKey(credentialsId: 'server-user', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'userName')]) {
remote.user = userName
remote.identityFile = identity
stage("SSH Steps Rocks!") {
sshCommand remote: remote, command: 'hostname'
}
}
}
При попытке выполнить этот код я получаю ошибку JNLP4-connect. Я добавил закрытый ключ в глобальные учетные данные jenkins. Что я здесь делаю не так? пожалуйста помоги. Заранее спасибо.
несколько строк журнала приведены ниже.
at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1743)
at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:357)
at hudson.remoting.Channel.call(Channel.java:957)
at org.jenkinsci.plugins.sshsteps.steps.CommandStep$Execution.run(CommandStep.java:72)
at org.jenkinsci.plugins.sshsteps.util.SSHStepExecution.lambda$start$0(SSHStepExecution.java:84)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
com.jcraft.jsch.JSchException: Auth cancel
at com.jcraft.jsch.Session.connect(Session.java:518)
at com.jcraft.jsch.Session.connect(Session.java:183)