Eitank
Eitank

Reputation: 692

Jenkins slave setup fails with private key authentication

i am encountering a weird issue when adding a new jenkins slave node. the steps that i have done are as followed:

  1. copied the public key from the master to the slave authorized_keys
  2. checked that i can connect from the master to the slave to make sure it works
  3. created keys on the slave and copied them to the new credentials.

getting the following error

picture of the error

further more, when i use the private key from the server to connect to it

ssh -i <path to private key> user@ip gives me the same error

Permission denied (publickey).

but when i connect without the argument (with my public key) then it works.

Upvotes: 0

Views: 2231

Answers (2)

Praveen
Praveen

Reputation: 1

you have to trust the key, in jenkins you have to select manually trusted key while adding the private key, then below that you have to check the check box for trusting the key, after saving that you'll get on the option to trust the host's key in nodes dash board.

Upvotes: 0

Petr Hecko
Petr Hecko

Reputation: 480

regarding your step 3 - are you saying that you are saving the slave private key in jenkins credentials? It should be the master private key you should have in your jenkins credentials and use that to connect to your slave.

Upvotes: 1

Related Questions