Handling Jupyter notebook password

We have set up Jupyter notebooks here and it is working great. However one question I have gotten a few times from users is “What is my password?” when they log out of Jupyter notebooks and they still have an active session. I am seeing how I can make this a bit more intuitive for users, as they won’t know to look in ~/ondemand/data/sys/dashboard/batch_connect/sys/jupyter/output/$session/connection.yml for the autogenerated password. I was thinking that most users would close the Jupyter session and start a new one when they are ready, but I find this is not always the case and I find that people are logging out and coming back later.

How are other sites handling this? I was thinking, is it possible that when Jupyter notebooks is launched and users see the Interactive Apps menu with the “Connect to Jupyter” button, can I edit that text to add a note in saying "If you log out, your autogenerated password for Jupyter is in /path/to/connection.yml ? If so, where would I find the file to edit?

I was also thinking of adding a note to manifest.yml so people see the note about the password before they submit the job, but I do think it may have a lesser chance of being skipped over and ignored if I put a note actually somewhere in the interactive session box under “My Interactive Sessions”. Any other ideas are appreciated as well.

Many thanks

Are your users trying to hit the jupyter API directly? They should always use the Connect to Jupyter button. That button reads the password file and submits the form with it. The real answer is that your users shouldn’t have to deal with this password nonsense, that it should “just work” and the button takes care of that automagically.

I imagine this is what’s going on, they are hitting the API directly by maybe bookmarks or getting the url from auto completion. Please let me know if this is not the case, as again, it should just work for these folks.

The file you’re looking to edit is view.html.erb just for reference in case you want to change anything in that form.

Ah got it. I admit I haven’t done my homework and also did not realize that hitting “connect to jupyter” again would leave them right back where they left off, now it is painfully obvious, sorry about that.

I think the logout page was a source of confusion, one person today said he logged out of his Jupyter notebook session then on coming back to it, thought he had to create a new session altogether as he didn’t know what the password was to resume where he left off. On logout it says “you are manually logged out, proceed to login page” then he arrived at that page with a password prompt unsure of what to do next.

Thanks for the tip on view.html.erb, I made a note there saying to simply click “connect to jupyter” again to resume the session so I think this should clear it up for folks in the future. Thanks so much.


OK yea, there is a logout in jupyter notebook and that also tripped me up because jupyter lab doesn’t seem to have that ability.

But yes, even if they logout, they can just reconnect through that button. Indeed there’s probably no reason ‘logout’.

In any case, glad to help!