Jenkins Publish over ssh authentification failed with private key

前端 未结 10 1019
小鲜肉
小鲜肉 2021-01-13 07:39

I can authenticate successfully with putty on the server with my private key and passphrase. But when I try to do it with jenkins publish o

相关标签:
10条回答
  • 2021-01-13 08:00

    Looks like you're using keyfile authentication, so you'll get this error from Jenkins if you haven't set the permissions correctly on your .ssh folder and/or ~/.ssh/authorized_keys file.

    • the .ssh folder should have drwx------ permissions (read/write/execute owner only)
    • the authorized_keys file should have -rw------- permissions (read/write owner only)

    To fix it:

    chmod 700 ~/.ssh
    chmod 600 ~/.ssh/authorized_keys
    
    0 讨论(0)
  • 2021-01-13 08:05

    Don't do any ssh-keygen. Just enter the pem key details under key field, Add SSH server details: Name, Hostname and Username as ec2-user. Click test connection and it works.

    0 讨论(0)
  • 2021-01-13 08:10

    Because your linux login need password, the answer is :

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

    SSH Servers

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

    Advanced --

    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
    

    'Test Configuration' success

    0 讨论(0)
  • 2021-01-13 08:10

    Sometimes the SSH connection would fail, if the destination server doesnt have enough disk space to perform PUT operation

    {ERROR: Exception when publishing, exception message [Failure]}
    

    Make sure to verify the destination server has enough disk space.

    In case of Linux, you can use 'df -kh /directoryname' to check the disk space

    0 讨论(0)
  • 2021-01-13 08:12

    I am facing same issue , the following steps work for me:- ( i am using jenkins 1.57)

    1. Go to http:///jenkins/manage
      1. Configure System
      2. Browse to Publish over SSH section
        • Passphrase: blank
        • path to key: blank
        • key : blank
        • Disable exec : un-check
        • SSH Servers -- Name: remote_user@remotehost.com -- hostname: remotehost.com -- Username: remote_user -- Remote Directory: empty -- Advanced -- check the box "use passsword authentication, or use a different key" -- port: 22 -- Timeout(ms): 300000 -- 'Test Configuration'

    success

    0 讨论(0)
  • 2021-01-13 08:12

    Try restarting ssh of remote server

            /etc/init.d/sshd restart
    
    0 讨论(0)
提交回复
热议问题