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 over 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 putty:
Hostname : myhostname
Username : myusername
Remote Directory :
Use password authentication, or use a different key Passphrase / Password
Path to key : checked
Path to key : mypath
Passphrase : mypasssword
Key:
Port:22
Timeout(ms):300000
If you have any idea ... Thanks for your help.
sshPublisher : Send build artifacts over SSH. Send files or execute commands over SSH. alwaysPublishFromMaster : boolean (optional) Select to publish from the Jenkins master. The default is to publish from the server that holds the files to transfer (workspace on the agent, or artifacts directory on the master).
Add SSH Key inside JenkinsIn the dropdown, select 'SSH username with private key' and then give a name for it. Copy the private key from the Jenkins server. Now you can clone any git repo in this Jenkins instance. You do not need to provide the credentials while configuring the job in Jenkins.
Use SSH during a buildThis plugin includes a builder which enables the use of the publisher during the build process. This means that you can send newly created packages to a remote server and install them, start and stop services that the build may depend on and many other use cases.
Add SSH Key inside Jenkins Now go to Credentials from left pane inside Jenkins console and then click global: Then Go to add new credentials. Kind dropdown, select 'SSH username with private key'.
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
I ran into the same issue today and it turned out i was accidentally supplying the path to the public key instead of the private one.
So the "path to key" should be something like
.ssh/id_rsa
instead of
.ssh/id_rsa.pub
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: [email protected]
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With