1

I have a Jenkins pod running in OpenShift.

I have enabled anyuid for my project as per http://appagile.io/2017/03/29/how-to-run-a-pod-as-root/.

However, I'm unable to get the initial admin password due to the following issue

<html><head><meta http-equiv='refresh' content='1;url=/login?from=%2F'                  /><script>window.location.replace('/login?from=%2F');</script></head><body     style='background-color:white; color:white;'>


Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:

 Permission you need to have (but didn't): hudson.model.Hudson.Read
 ... which is implied by: hudson.security.Permission.GenericRead
 ... which is implied by: hudson.model.Hudson.Administer
-->

As per the solution mentioned in this - https://stackoverflow.com/a/41055670

I tried adding jenkins user as part of root.

sudo usermod -a -G root jenkins

But sudo package was not installed in the Jenkins pod. I tried su -i but it's asking for root password which I don't know.

In Docker, I use docker exec -u root option to log in as root. But I don't see any such option in oc. Are there any other option we can try to resolve this issue?

smc
  • 2,175
  • 3
  • 17
  • 30
  • What is the user you are logged in the pod initially when you exec into it, and what image you are using to spin it up? – Const Jul 21 '18 at 19:29
  • 1
    Why does it need to run as root in the first place? Explain the problem you are trying to solve. If know that, rather than just the solution you are trying to get working, then can possibly suggest a better way of doing it that doesn't need root. – Graham Dumpleton Jul 21 '18 at 21:31

0 Answers0