<p>I am trying to log into a kubernetes pod using the kubectl exec command. I am successful but it logs me in as the root user. I have created some other users too as part of the system build. </p>

<p>Command being used is "kubectl exec -it  /bin/bash". I guess this means that run /bin/bash on the pod which results into a shell entry into the container.</p>

<p>Can someone please guide me on the following -</p>

<ol>
<li>How to logon using a non-root user?</li>
<li>Is there a way to disable root user login?</li>
<li>How can I bind our organization's ldap into the container?</li>
</ol>

<p>Please let me know if more information is needed from my end to answer this?</p>

<p>Thanks,</p>

<p>Anurag</p>

<p>You can use <code>su - &lt;USERNAME&gt;</code> to login as a non-root user.</p>

<p>Run  <code>cat /etc/passwd</code> to get a list of all available users then identify a user with a valid shell compiler e.g</p>

<p><code>/bin/bash</code> or <code>/bin/sh</code></p>

<p>Users with <code>/bin/nologin</code> and <code>/bin/false</code> as the set compiler are used by system processes and as such you can't log in as them.</p>
