TAGS :Viewed: 8 - Published at: a few seconds ago

[ Is it possible to start an IPython session via ssh and log back in later? ]

I work on a machine per ssh where I run ipython for interactive work. Can I start a long-running Python function from IPython, sever the ssh connection and log back in later into the IPython session to observe the result?

Answer 1


Yes. Use screen, tmux (superior), or similar software. Both use the concept of sessions that you attach to and detach from.

With tmux:

  1. Run tmux and then ipython.
  2. When you're finished, <Ctrl+b> d to detach. You're back in the normal shell.
  3. When you come back, tmux attach will take you back to ipython.

Using screen, the commands are screen, <Ctrl+a> <Ctrl+d> and screen -r.