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
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.
.ssh
folder should have drwx------
permissions (read/write/execute owner only)authorized_keys
file should have -rw-------
permissions (read/write owner only)To fix it:
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
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.
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
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
I am facing same issue , the following steps work for me:- ( i am using jenkins 1.57)
success
Try restarting ssh of remote server
/etc/init.d/sshd restart