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

后端 未结 8 1443
忘掉有多难
忘掉有多难 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:21

    1) First make jenkins as real user by editing /etc/passwd file Change

    /bin/false to /bin/bash

    2) Login to jenkins user, Now Jenkins home directory will be /var/lib/jenkins

    su - jenkins
    

    3)Generate ssh keys again ( keys will be created in /var/lib/jenkins/.ssh)

    ssh-keygen -t rsa
    

    4) copy id_rsa.pub key and paste in your git's authorized_keys file

    5) Still if it won't work, probably you have to check permissions of your .ssh directory and contents

    chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
    

提交回复
热议问题