RDX
RDX

Reputation: 155

From Jenkins run getting the following error while ssh: Permission denied (publickey,password,keyboard-interactive)

When I am doing ssh to a remote windows machine from the linux CLI running the following command it works:

ssh -tt username@ip_address

However when I am running the same via Jenkins, it throws the following error:

+ ssh -tt username@ip_address
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password,keyboard-interactive)

So what could be going wrong? I believe this has nothing to do with the ssh-keys because manually running the above command from the CLI works but fails only from the Jenkins.

I am new to Jenkins and hence don't have much idea about the details of Jenkins. Please share what could be going wrong.

Thanks.

Upvotes: 2

Views: 3824

Answers (1)

VonC
VonC

Reputation: 1329082

First, check with which account Jenkins is running: if it is not the same as the one used for your ssh test in command-line, it would not access the same ~/.ssh/id_rsa private key.

Second, try and specify the same key (assuming no passphrase) to the SSH plugin configuration or the SSH pipeline step, to make sure it uses the right file.

Upvotes: 2

Related Questions