Permission denied (publickey) when setting up Jenkins

前端 未结 4 1358
广开言路
广开言路 2020-11-28 14:54

I am setting up Jenkins on a Win 2008 server machine and am having some trouble configuring Jenkins to connect to GitHub. I get the following error:

Command          


        
4条回答
  •  [愿得一人]
    2020-11-28 15:21

    As I commented, specifying the HOME environment variable is key, when using ssh protocol.
    Since Windows doesn't have a HOME, you need to define it explicitly, to whatever directory you want.

    However, Vestnik comments:

    I've specified to override HOME on the windows slave node to point it to C:\jenkins.
    I've put correct id_rsa under the C:\jenkins\.ssh but still have this issue.
    My slave agent running as service under SYSTEM account.

    • Similar issue: "Problem with Hudson + Git + Gitosis on windows"
    • Similar resolution: "Problem with Hudson + Git + Gitosis on windows"

    Two advices:

    • you need to make your slave display 'set' in order to check if HOME is defined when used with the SYSTEM account.
      If it is not, that may mean you need to add that variable to the "system environment variables", not the "user environment variables".

    display env from the job definition

    • Don't forget to have both id_rsa and id_rsa.pub in the %HOME%\.ssh directory: you need both public and private ssh keys. (as mentioned in "git clone with ssh issue")

    If you have a parametrized build, you also can define HOME that way and check if your slave picks up the right value for HOME:

    define custom variables

提交回复
热议问题