Auto logging out idle user

873 views
Skip to first unread message

Sandbo Chang

unread,
Feb 10, 2016, 1:14:48 PM2/10/16
to Project Jupyter
Hi,

would there be a feature that allows the Jupyter notebook server to logout idle users after a defined amount of time?
That would be a good safety measure if available.

Matthias Bussonnier

unread,
Feb 10, 2016, 1:18:35 PM2/10/16
to jup...@googlegroups.com
that's likely doable with an extension. But it depends what you consider "inactivity". No execution in the kernel ?
No connexion on the web socket ? Browser window not in focus ?

What is your setup ?

Also that would likely not be put in core. 
-- 
M




--
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/8bbc508a-969c-416d-9fb3-2ea23f288d0c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sandbo Chang

unread,
Feb 10, 2016, 1:25:01 PM2/10/16
to Project Jupyter
Thanks for the reply,
that's a good point to regarding the exact meaning of idling, I am worried I was a bit unclear.

The server is new so I can't really accurately describe how it is being used.
It is, for example, I logged on to a session and worked on a script for a while, then I simply closed my browser and went home.
On the other day I come back, I opened up the browser and tried to access my server, it skipped the login screen and directed me to the index page.

I was then wondering if there is a way to detect if the user has closed the browser.
It is more like any online banking but simpler; there may not be a need to kick a user after a certain amount of time (if that is hard to implement),
but it will be useful to logout automatically if the browser is closed.

Laurent Gautier

unread,
Mar 22, 2016, 8:42:07 PM3/22/16
to Project Jupyter
Bumping this up. I'd like to see timeout as an option in the jupyter notebook (better if in the core).

Limiting the validity of a given authentication would be desirable in contexts where the jupyter notebook server is meant to be running for long periods of time, users can possibly be sharing machines (windows desktops are very common in experimental labs), and session highjacking is not something people want to see (I know that user *should* logout but there are a number of other things that users *should* do and here software can support users).

The validity is most often not calculated as simply wall clock time since authentication but factors the activity, that is authentication is valid for as long as a user is active on the client. In the case of the notebook this means cell input (the server going on a long compute does not qualify as user activity on the client).

I'd think that detecting whether the browser has closed might be the hardest of all options. 

MinRK

unread,
Mar 23, 2016, 7:53:07 AM3/23/16
to jup...@googlegroups.com
JupyterHub is where most of our authentication logic resides. It does not have activity-based authentication expiry, but it does track activity, so it could be added.

-MinRK

Ryan Martin

unread,
Apr 6, 2016, 9:34:33 AM4/6/16
to Project Jupyter
I would also like to upvote having this feature in the core. As a starter, it could be based on the time that Jupyterhub posts on the "admin" page showing the last activity of users. 
Ryan.

Andy Davidson

unread,
Apr 6, 2016, 11:57:58 AM4/6/16
to jup...@googlegroups.com
I would also like some sort of admin control to automatically log out idle users. The trick is how to define “idle” users. My users are running apache spark programs over huge data sets. In general we try to encourage them to use jupiter to develop their initial code using smaller data sets and then to save the notebook as python and run in batch mode (i.e. Out side of jupiter) on production data sets

Kind regards

Andy

MinRK

unread,
Apr 6, 2016, 5:23:04 PM4/6/16
to Project Jupyter

To be clear, you can already shutdown servers that have been idle for a period, using the cull idle service. What you cannot yet do is logout the user (invalidate their cookie) so that they have to login again. Logging out and stopping the server don’t have to be related (you can stop the server without logging out, and log out without stopping the server).

-MinRK


Sander Stepanov

unread,
Jun 2, 2016, 3:04:40 PM6/2/16
to Project Jupyter
so wha to do ?,
I try use ipython from amazon AWS server, but sessoin is closed after 3 minutes 

Sander Stepanov

unread,
Jun 8, 2016, 3:57:38 PM6/8/16
to jup...@googlegroups.com

I use now screen 
https://www.youtube.com/watch?v=hB6Y72DK8mc
and run 
ipython notebook --no-browser
from screen 
so it looks like this 
1
ssh to AWS
ssh -i rtlm-dev2.pem ec2-...@54.221.50.61
2
screen
3

ipython notebook --no-browser
4
go to MAC computer and make tunnel
ssh -N -f -L localhost:8889:localhost:8888 -i rtlm-dev2.pem ec2-...@54.242.110.101
5
type in safari browser

http://localhost:8889

this way I do have ipython from AWS for 1-3 hours

but now there is another problem
when ssh failes
ipython continue make calculations but graphic outpu is in visible in ipython notebook,
but when I run some simple code at the end of note book in new cell
like x=5
this execution is not happened and cell is market by * like it weights till main calculation finished
also top command on AWS server show that Ipython is running like this
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
5971 ec2-user 20 0 8695m 5.3g 22m S 500.0 9.0 518:48.97 python
6551 ec2-user 20 0 13.3g 8.8g 22m S 400.2 14.9 315:17.09 python
7219 ec2-user 20 0 2724m 457m 21m R 100.8 0.8 32:49.85 python
7464 ec2-user 20 0 2594m 608m 21m R 100.1 1.0 30:18.89 python
7145 ec2-user 20 0 3447m 1.2g 22m R 99.8 2.0 34:10.36 python
7302 ec2-user 20 0 3428m 1.1g 22m R 99.8 1.9 31:27.95 python
5555 ec2-user 20 0 435m 51m 6536 S 0.3 0.1 0:19.32 ipython
1 root 20 0 19636 1628 1316 S 0.0 0.0 0:01.19 init
2 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:00.00 ksoftirqd/0

I really need to use ipython from AWS may you help pls

how to use these running ipython notebooks, but there is no updating ot outputs


--
You received this message because you are subscribed to a topic in the Google Groups "Project Jupyter" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jupyter/G5C0nk2cHew/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jupyter+u...@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages