Reputation: 1234
I am trying to pull some documents from git using git clone
as part of a jenkins process. Git clone works fine separately, but as a part of jenkins, I am facing permission denied issue
> echo "pw"| sudo git clone host@IP:git-repo
> Cloning into 'git-repo'...
Permission denied, please try again.
Permission denied, please try again.
Permission denied(publickey,password).
fatal: Could not read from remote repository.
Upvotes: 4
Views: 2406
Reputation: 1258
Try this,
superuser ALL=(ALL) NOPASSWD:ALL - for single user
refer link
This setting help us to bypass user prompt.
Upvotes: 0
Reputation: 46
Jenkins creates a system user to your system with name jenkins.
Try adding jenkins user to sudores using this link and give permissions to this user, add SSH(git) key for git clone.
This may solve your issue. :)
Upvotes: 1
Reputation: 25491
Try using the SSH Agent plugin to make your private key accessible to regular build steps.
Upvotes: 1