2

To access a git repository from Jenkins, I need to login as this user and execute some commands (according to e.g. http://www.uvd.co.uk/blog/labs/configuring-jenkins-continuous-integration-server-to-work-with-git/, Jenkins Host key verification failed or Managing SSH keys within Jenkins for Git, I need to accept the host to known hosts and generate an ssh-key. I created the key with the root user, and added credentials to jenkins - it does not work, and therefore I assume it is still the wrong known hosts). But everytime I do su jenkins, the following appears:

reichelt@aspra4:~$ su jenkins
No passwd entry for user 'jenkins'

Even the solution recommended here: how to run script as another user without password does respond the same thing:

reichelt@aspra4:~$ su -c "git ls-remote -h ... HEAD" -s /bin/sh jenkins
No passwd entry for user 'jenkins'

But nevertheless, I need to connect somehow to the server. Does anybody has an hint how to get this working?

Community
  • 1
  • 1
David Georg Reichelt
  • 963
  • 1
  • 15
  • 36

2 Answers2

0

You need to create a user called Jenkins using adduser or whatever the command is for your unix.

David Roussel
  • 5,788
  • 1
  • 30
  • 35
0

I faced similar problem, My solution to this problem is add jenkins to sudo list and change it's password

Code:

sudo adduser jenkins sudo

passwd jenkins

Now next time you do su jenkins it should work.

Avinash Agrawal
  • 1,038
  • 1
  • 11
  • 17