Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Authentication failed. No private key accepted. #602

Closed
ltutar opened this issue Jun 14, 2016 · 3 comments
Closed

Authentication failed. No private key accepted. #602

ltutar opened this issue Jun 14, 2016 · 3 comments

Comments

@ltutar
Copy link

ltutar commented Jun 14, 2016

I have the following yaml and #352 did not help me.

jenkins::install_java: false
jenkins::cli: true
jenkins::cli_ssh_keyfile: "/var/lib/jenkins/.ssh/id_rsa"
jenkins::security::security_model: 'full_control'

and the following keys:

[root@jenkinsagent .ssh]# pwd
/var/lib/jenkins/.ssh
[root@jenkinsagent .ssh]# ls -al
total 16
drwxr-xr-x.  2 jenkins jenkins 4096 Jun 13 11:01 .
drwxr-xr-x. 11 jenkins jenkins 4096 Jun 10 13:55 ..
-rw-r--r--.  1 jenkins jenkins 3239 Jun 10 13:52 id_rsa
-rw-r--r--.  1 jenkins jenkins  738 Jun 10 13:52 id_rsa.pub
[root@jenkinsagent .ssh]# 

that I created with

ssh-keygen -t rsa -b 4096

When I run puppet agent for jenkins-1.651.2-1.1.noarch.rpm or jenkins-1.658-1.1.noarch.rpm, I also get the error:

Notice: /Stage[main]/Motd/File[/etc/motd]/content: content changed '{md5}3311e50be94448f561b4bde47ece3e94' to '{md5}fcb30103eca7d534640e3d55da76ce0b'
Notice: /Stage[main]/Jenkins_config::Config/Jenkins::Credentials[tutti]/Jenkins::Cli::Exec[create-jenkins-credentials-tutti]/Exec[create-jenkins-credentials-tutti]/returns: Authentication failed. No private key accepted.
Error: /usr/bin/java -jar /usr/lib/jenkins/jenkins-cli.jar -s http://127.0.0.1:8080 -i /var/lib/jenkins/.ssh/id_rsa groovy /usr/lib/jenkins/puppet_helper.groovy create_or_update_credentials tutti 'frutti1' '3ab58aaf-5692-420b-b889-c6c5f337cf0b' 'gitblit user tutti - managed by Puppet' '' returned 255 instead of one of [0]
Error: /Stage[main]/Jenkins_config::Config/Jenkins::Credentials[tutti]/Jenkins::Cli::Exec[create-jenkins-credentials-tutti]/Exec[create-jenkins-credentials-tutti]/returns: change from notrun to 0 failed: /usr/bin/java -jar /usr/lib/jenkins/jenkins-cli.jar -s http://127.0.0.1:8080 -i /var/lib/jenkins/.ssh/id_rsa groovy /usr/lib/jenkins/puppet_helper.groovy create_or_update_credentials tutti 'xebia1' '3ab58aaf-5692-420b-b889-c6c5f337cf0b' 'gitblit user tutti - managed by Puppet' '' returned 255 instead of one of [0]

This is the resource that I call:

  jenkins::credentials { $gitblit_username:
    password            => "$gitblit_password",
    private_key_or_path => '',
    uuid                => '3ab58aaf-5692-420b-b889-c6c5f337cf0b',
    description         => "gitblit user ${gitblit_username} - managed by Puppet",
  }

Java:

[root@jenkinsagent tmp]# java -version
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
[root@jenkinsagent tmp]# 

Would anybody help me point out what I am missing?

@sdiepend
Copy link

You'll have to add the public key manually via the gui to a user which has enough rights to use the cli.

@ltutar
Copy link
Author

ltutar commented Jun 30, 2016

Thank you. I will try it. I did not do this step since it was not mentioned in #352

@jhoblitt
Copy link
Member

Assuming this has been resolved.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@jhoblitt @sdiepend @ltutar and others