LDAP ja home directory creation

51 views
Skip to first unread message

Jori Mäntysalo

unread,
Oct 27, 2016, 1:01:17 AM10/27/16
to jup...@googlegroups.com
I want to authenticate over LDAP and use Sagemath as a kernel.

Is it possible to hook automatic home directory creation to LDAP
authenticator? From uid LDAP will give home directory, usually
/home/staff/uid or /home/stud/uid. I would like to have all Sage data
located on same Sage server, so that login with new uid would create
/home/uid.

(Later I want to have both LDAP and local accounts available, so that the
system would behave like SageNB works now.)

--
Jori Mäntysalo

MinRK

unread,
Oct 31, 2016, 9:21:32 AM10/31/16
to Project Jupyter

You might want to override Spawner.start to do the actions you are looking for when a user’s server starts.

from jupyterhub.spawner import LocalProcessSpawner
class MySpawner(LocalProcessSpawner):
    def start(self):
        setup_home_directory(self.user.name) # < define this function
        return super().start()

c.JupyterHub.spawner_class = MySpawner

-Min

Yuvi Panda

unread,
Oct 31, 2016, 11:51:23 AM10/31/16
to Project Jupyter
You could use https://github.com/benhosmer/jupyterhub-ldapcreateusers
as well. I'll probably extract the useful bits out of that into a more
generic package at some point...
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+u...@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/CAHNn8BX3sEnqn%2Brp5VkTu7d7WmhjbjELCZKeYtMr1PKaNOF4-A%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



--
Yuvi Panda T
http://yuvi.in/blog

Jori Mäntysalo

unread,
Nov 6, 2016, 1:46:59 AM11/6/16
to Project Jupyter
On Mon, 31 Oct 2016, Yuvi Panda wrote:

> You could use https://github.com/benhosmer/jupyterhub-ldapcreateusers
> as well.

It works, but only if /home has write permission to all users.

For now I freezed this path and continue using SageNB. There are several
reason, one of them being this and another the possibility to share
worksheets.

--
Jori Mäntysalo
Reply all
Reply to author
Forward
0 new messages