Access to user Notebook/JupiterLab without password from admin

Hi there!

Is there a way to get access from admin user to any other user Notebook/JupiterLab without any password? I mean how can a teacher to get access to sudents enviroments without password?

It it’s possible, can you give an example how to do it please?

Thank you!

P.S. I’m using TLJH.

access to user servers is governed by the access:servers scope. If you grant instructors access to student servers, you can add this scope. You can further restrict the scope to only certain users, e.g. by name or by group.

Here’s an example, assuming you have students in group class-123, instructors in group instructors-123:

# add users to groups
c.JupyterHub.load_groups = {
    "intructors-123": [
        "teacher1",
    ],
    "class-123": [
        "student1",
    ],
}

c.JupyterHub.load_roles = [
    {
        "name": "instructors-123",
        # grant members of the 'instructors-123' group
        # permission to access the servers of the 'class-123' group
        "groups": ["instructors-123"],
        "scopes": [
            # or without the `!group...` filter to grant access to _all_ servers
            "access:servers!group=class-123",
        ],
    }
]

Note that this does not include the ability to start user servers. If you want that, too, that would mean adding the servers!group=class-123 scope.