Issue
I connect to a remote server using ssh -L
but if I close the laptop lid or the connection is lost, the jupyter notebook is disconnected.
After I reconnect to the remote server, the "last" session is lost.
What can be done to make it persistent?
Could screen
help with it?
Solution
On the remote server, you should open your jupyter in a screen
session, it will make it persistent if you lose the connection to the server and resume it.
- On your computer:
ssh -L xxxx:localhost:yyyy server
. screen
.jupyter notebook --no-browser --port=yyyy
. [on remote server]- In your browser:
localhost:xxxx
.
To disconnect manually and reconnect:
- Exit the screen window:
control + a
and thend
. - Disconnect from the server:
control + d
- And reconnect
ssh -L xxxx:localhost:yyyy
. - Optionally, you can reopen the screen window, though unnecessary, using
screen -r
. - Go back to your notebook or reopen
localhost:xxxx
.
Answered By - BiBi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.