<p>I have been trying to deploy JupyterHub on my Kubernetes cluster (on 3 virtualbox nodes) and willing to use PAM authentication but unfortunately there is nothing in the documents. 
I would appreciate if somebody explain the steps briefly, or at least give me some hint to follow.</p>

<p>I'll give more information if needed.</p>

<p>Thanks,  </p>

<p>Basically, the <a href="https://jupyterhub.readthedocs.io/en/stable/api/auth.html#pamauthenticator" rel="nofollow noreferrer">PAM authenticator</a> would be configured the same way that you would on any Linux machine except that in this case, you would be doing it in the containers in running in your JupyterHub on your Kubernetes cluster.</p>

<p>You could build you customer container base on the base for JupyterHub and then add users as you build the container:</p>

<p>Dockerfile:</p>

<pre><code>FROM jupyterhub/jupyterhub
RUN adduser -q –gecos "" –disabled-password &lt;username1&gt;
RUN adduser -q –gecos "" –disabled-password &lt;username2&gt;
...
</code></pre>

<p>Build the container:</p>

<pre><code>$ docker build -t myjupyterhub .
</code></pre>

<p>Alternatively, you could create an <code>entrypoint.sh</code> script that creates the users. Something like this:</p>

<pre><code>#!/bin/bash
adduser -q –gecos "" –disabled-password &lt;username1&gt;
adduser -q –gecos "" –disabled-password &lt;username2&gt;
...
&lt;start-jupyterhub&gt;
</code></pre>

<p>Make it executable:</p>

<pre><code>$ chmod +x entrypoint.sh
</code></pre>

<p>Then on your Dockerfile, something like this:</p>

<pre><code>FROM jupyterhub/jupyterhub
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
...
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
</code></pre>

<p>You could also play around with <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer">ConfigMaps</a> and see if you can use them to add the users but that means that you will have to understand more on how PAM is configured and what the <code>adduser -q –gecos "" –disabled-password &lt;username1&gt;</code> actually does for example.</p>
