简体   繁体   中英

Jenkins(Windows ) unable to clone through git(Linux) repository

Set-up Details:

JENKINS on windows 10

GIT plugin setup done

public private key setup done

Cloning repository through CMD works 通过CMD克隆存储库

git clone through Jenkins fails with below error

"C:\Program Files (x86)\Jenkins\workspace\Aclselenium>git clone rahulp@10.0.6.194:/Operations/repo/git/test.git 
Cloning into 'test'...
Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists."

JENKINS控制台日志

Running below commands through windows cmd

"whoami" command gives > "acl-wireless\rahulp"

"echo %USERNAME%" command gives `> "rahulp"`

Where as when I run above command through JENKINS I receive:

"whoami" command gives > "nt authority\system"

"echo %USERNAME%" command gives `> "RAHULPANDEY$ RAHULPANDEY$"`

Your command line access to git and your jenkins access to git are two different things. From command line, you will be given your username and password to login. But from jenkins you need to configure credentials. Go to Manage Jenkins => Configure System => GitHub and please give the credentials there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM