Jenkins Publish authentication via ssh failed with private key

I can authenticate successfully with puttythe server using private keyand passphrase. But when I try to do this using jenkins to publish via the SSH plugin (using Test for configuration), I get the following error message:

jenkins.plugins.publish_over.BapPublisherException: Failed to connect session for config myconfig. Message [Auth fail]

I entered the same information as in the spackler:

Host Name : myhostname
Username : myusername
Remote directory :

Use authentication password, or use a different key. Password / password path to the key : marked
path to the key : mypath
passphrase : mypasssword
Key :
Port : 22
Timeout (ms) : 300000

If you have an idea ... Thank you for your help.

+4
source share
6 answers

, , Jenkins, .ssh / ~/.ssh/authorized_keys.

  • .ssh drwx------ ( //)
  • authorized_keys -rw------- ( /)

:

chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
+8

, , .

, " " -

.ssh/id_rsa

.ssh/id_rsa.pub
+3

, .ssh/authorized_keys , jenkins. , , , , , ssh localhost .

(Addendum: , jenkins .ssh/known_hosts, .)

+2

, :

, 3 , , SSH Jenkins.

/ , . , , .

. .

Key . .

exec .

+1

, : - ( jenkins 1.57)

  • http:///jenkins/manage
    • SSH
      • :
      • :
      • : blank
      • exec: un-check
      • SSH - : remote_user@remotehost.com - : remotehost.com - : remote_user - : - - " " - : 22 - - (): 300000 - ' '

0

Linux , :

 1. Passphrase: your passphrase
 2. path to key: your private key path
 3. key : blank
 4. Disable exec : un-check

SSH

1. Name: remote_user@remotehost.com
 2. hostname: remotehost.com
 3. Username: remote_user
 4. Remote Directory: empty

-

5. check the box "use passsword authentication, or use a different key"
    `important`

 6. Passphrase / Password: your linux login password`important`

 7. path to key: blank

 8. key:blank

 9. port: 22

 10. Timeout(ms): 300000

0

Source: https://habr.com/ru/post/1531290/


All Articles