Setting up jenkins on centos: problems with ssh keys and git

后端 未结 8 1419
忘掉有多难
忘掉有多难 2021-02-15 16:46

Went through a lot of questions, but nothing seems to be solving my issue. Or to be more precise I am not sure if I am doing the whole thing correctly. So here it is:

Ha

相关标签:
8条回答
  • 2021-02-15 17:34

    I'm assuming that you have root access if you were able to install the Jenkins RPM. Were you su-ing to the jenkins user while logged in as root ? If not, you should do so or use

    sudo su - jenkins
    

    if your logged in user has sudo access.

    Then run

    ssh-keygen -t rsa
    

    to generate an RSA keypair for the jenkins user, and you can upload the public key to your git server. The key will be generated as /var/lib/jenkins/.ssh.id_ra.pub if you take the defaults.

    0 讨论(0)
  • 2021-02-15 17:40

    1 change user jenkins login setting

    vi /etc/passwd

    update /bin/false to /bin/bash

    2 su - jenkins

    jekins user home would be /var/lib/jenkins

    3 ssh-keygen

    cat .ssh/id_rsa.pub

    copy this key to bitbucket

    4 ssh git@bitbucket.org

    this is going to set the bitbucket ssh key in .ssh/known_hosts

    Now you should be able to access

    0 讨论(0)
提交回复
热议问题